Template:Percentage table
This template creates a tightly spaced list of items with percentages beside each item.
The percentage table is designed to be used as a parameter within other templates. It can present up to 15 pairs of data.
It can technically be used for any information displayed as percentages, and can even be used outside of infoboxes, but it's primary use on this wiki is in infoboxes displaying the population of species in a given location, such as a settlement or realm.
Usage
Wikilinks can be used inside each "label" parameter.
The format is essentially "info|#| info|#| info|#". Fill in each label parameter with a word or phrase, and each data parameter with a numeber to displayed as a percentage.
Each "data" parameter should only include numeric characters—the template adds the "%" automatically.
{{percentage table | label1 | data1 | label2 | data2 | label3 | etc. }}
If a more easily-readable code layout is desired, the individual parameters can also be listed vertically:
{{percentage table |
label1 | data1 |
label2 | data2 |
label3 | etc. }}
Examples
| Diamond Lake | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| General information | |||||||||||||
| Realm: | Domain of Greyhawk | ||||||||||||
| Demographics | |||||||||||||
| Population: | 2,376 | ||||||||||||
| Races: |
| ||||||||||||
This is an example of the percentage table template being used inside a {{Settlement}} template. The wikitext shown in both examples below produce the same infobox.
Example #1:
{{Settlement
| name = Diamond Lake
| realm = [[Domain of Greyhawk]]
| population = 2,376
| races = {{percentage table|[[Human]]s|84|[[Elf|Elves]]|9|[[Halfling]]s|7|[[Dwarf|Dwarves]]|5|[[Orc]]s|4|[[Tiefling]]s|1 }}
}}
Example #2:
{{Settlement
| name = Diamond Lake
| realm = [[Domain of Greyhawk]]
| population = 2,376
| races = {{percentage table |
[[Human]]s | 84 |
[[Elf|Elves]] | 9 |
[[Halfling]]s | 7|
[[Dwarf|Dwarves]] | 5 |
[[Orc]]s | 4 |
[[Tiefling]]s | 1 }}
}}