Template:Medals table
Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
Totals (0 entries) | 0 | 0 | 0 | 0 |
![]() | This template is used on approximately 15,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
![]() | This template uses Lua: |
A template for generating a medals table for a sporting event where the totals and ranks are automatically calculated.
Template basics
<syntaxhighlight lang="wikitext" style="overflow: auto;">
Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
Totals (0 entries) | 0 | 0 | 0 | 0 |
</syntaxhighlight> Lua error: bad argument #1 to 'formatNum' (number expected, got string).
Parameters
Some of the optional parameters
Parameter | Explanation |
---|---|
caption |
The caption or title given to the table |
host |
The host entity. If set to a 3 letter code matching one of the rows, the host name will be automatically formatted. Otherwise this param will override the host text. |
flag_template |
Which of the many flag templates to use. If left blank, {{flag country}} will be used. |
event |
For flag templates which require a 2nd parameter (such as {{flag IOC team}}) this param will be that 2nd param. |
team |
An optional override for the header to column 2. The default is "Nation". |
hide_rank |
When set the rank column will be hidden. |
hide_totals |
When set the totals row will be hidden. |
For a list of valid IOC values, see List of IOC country codes
In case of multiple hosts, use |host1=
and |host2=
Blank with all IOC codes
The below template contains a condensed version of the template with ALL IOC country codes included. Obviously not all are needed. You are free to pick and choose those that you need for your implementation of the template.
Template
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
<syntaxhighlight lang="wikitext" style="overflow: auto;">
</syntaxhighlight> |
Event & Flag Template
If {{{event}}}
and {{{flag_template}}}
are given values, then the nation value will be rendered as {{<flag_template>|<IOC>|<event>}}
.
So for example, with the following params: <syntaxhighlight lang="wikitext" style="overflow: auto;">
Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
Totals (0 entries) | 0 | 0 | 0 | 0 |
</syntaxhighlight>
The nations will be rendered as United States (USA) &
Canada (CAN)
Example
<syntaxhighlight lang="wikitext" style="overflow: auto;">Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
1 | ![]() | 7 | 4 | 4 | 15 |
2 | ![]() | 5 | 5 | 5 | 15 |
3 | ![]() | 5 | 3 | 2 | 10 |
4 | ![]() | 3 | 5 | 7 | 15 |
5 | ![]() | 3 | 4 | 3 | 10 |
6 | ![]() | 1 | 3 | 3 | 7 |
Totals (6 entries) | 24 | 24 | 24 | 72 |
Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
1 | ![]() | 7 | 4 | 4 | 15 |
2 | ![]() | 5 | 5 | 5 | 15 |
3 | ![]() | 5 | 3 | 2 | 10 |
4 | ![]() | 3 | 5 | 7 | 15 |
5 | ![]() | 3 | 4 | 3 | 10 |
6 | ![]() | 1 | 3 | 3 | 7 |
Totals (6 entries) | 24 | 24 | 24 | 72 |
Example2
<syntaxhighlight lang="wikitext" style="overflow: auto;"> * Host nation (Slovakia)Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
1 | ![]() | 9 | 9 | 9 | 27 |
2 | ![]() | 5 | 5 | 5 | 15 |
3 | ![]() | 4 | 4 | 4 | 12 |
– | Independent Athletes[4] | 1 | 1 | 0 | 2 |
4 | ![]() | 0 | 0 | 1 | 1 |
Totals (4 entries) | 19 | 19 | 19 | 57 |
Rank | Nation | Gold | Silver | Bronze | Total |
---|---|---|---|---|---|
1 | ![]() | 9 | 9 | 9 | 27 |
2 | ![]() | 5 | 5 | 5 | 15 |
3 | ![]() | 4 | 4 | 4 | 12 |
– | Independent Athletes[6] | 1 | 1 | 0 | 2 |
4 | ![]() | 0 | 0 | 1 | 1 |
Totals (4 entries) | 19 | 19 | 19 | 57 |
References
- ^ Medal Tally
- ^ Medal Tally
- ^ Medal Tally
- ^ this is a note
- ^ Medal Tally
- ^ this is a note