Template:Tournament table template documentation
The templates in the series are intended for use in tournament performance tables for articles such as darts, snooker, and tennis players. For an example, see Phil Taylor career statistics#Performance timeline. These come in 2 varieties, cell templates for use in individual cells of the table, and legends to unify the tables across Wikipedia.
For example, {{TournW}}
makes a cell with a green background and bold W. The optional link in the cell is taken from the first parameter; and the option to change text comes from the second parameter. So {{TournW|link}}
and {{TournW|link|new text}}
are also options. The intention is generally that the first parameter is the link to that specific edition of the tournament, with no "[[" required.
If you want to use other attributes for the table cells, e.g. colspan
or rowspan
, they need to be put before the template call and there must be no vertical bar |
in between them:
W | RU | N/A |
---|---|---|
Last 32 |
<syntaxhighlight lang="wikitext">... !style="background: lime; vertical-align: middle; text-align: center; " class="table-tournament"| W |style="background: thistle; vertical-align: middle; text-align: center; " class="table-tournament"| RU |rowspan=2 data-sort-value="" style="background: #fafafa; color: #737373; vertical-align: middle; font-size: smaller; text-align: center; " class="table-tournament" | N/A |- |colspan=2 style="background: #afeeee; vertical-align: middle; text-align: center; " class="table-tournament"| Last 32 ... </syntaxhighlight>
Templates
Default | Default with link | Other text with link | Other text with no link | ||||
---|---|---|---|---|---|---|---|
Syntax | Preview | Syntax | Preview | Syntax | Preview | Syntax | Preview |
{{TournW}} | W | {{TournW|2010 UK Open}} | W | {{TournW|2010 UK Open|Won}} | Won | {{TournW||Winner}} | Winner |
{{TournRU}} | RU | {{TournRU|2010 UK Open}} | RU | {{TournRU|2010 UK Open|F}} | F | {{TournRU||2nd}} | 2nd |
{{TournSF}} | SF | {{TournSF|2010 UK Open}} | SF | {{TournSF|2010 UK Open|Top 4}} | Top 4 | {{TournSF||3rd}} | 3rd |
{{TournQF}} | QF | {{TournQF|2010 UK Open}} | QF | {{TournQF|2010 UK Open|Top 8}} | Top 8 | {{TournQF||7th}} | 7th |
{{TournLR}} | RR | {{TournLR|2010 UK Open}} | RR | {{TournLR|2010 UK Open|2R}} | 2R | {{TournLR||Last 32}} | Last 32 |
{{TournDQ}} | DQ | {{TournDQ|2010 UK Open}} | DQ | {{TournDQ|2010 UK Open|Banned}} | Banned | {{TournDQ||Barred}} | Barred |
Default | Other text | No text | |||||
Syntax | Preview | Syntax | Preview | Syntax | Preview | ||
{{TournNA}} | N/A | {{TournNA|Did not play}} | Did not play | {{TournNA|}} |
Also, for a legend that can be used on most pages containing these cell templates
{{TournLegend}}
generates the following table:
Code
Common code to most if not all the templates in this series: <syntaxhighlight lang="wikitext">|style="background: #abcdef; vertical-align: middle; text-align: center; " class="table-tournament"| XX</syntaxhighlight>