Template:Incorrect
| Incorrect |
The templates in this series are designed to be used in a table to make a cell with text in that cell, with an appropriately colored background. They are commonly used in comparison tables.
For example, {{yes}} makes a cell with a green background. The text in the cell is taken from the first parameter; {{yes|Sure}} would output "Sure" otherwise it defaults to "Yes". Most templates allow authors to override the default text in this way, some require text put after the template call and some also need a vertical bar in between: {{table cell template}} text or {{table cell template}} | text. This information, the colors and default texts are found in the table below.
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:
| Yes | No | N/A |
|---|---|---|
| Yes/No | ||
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...
Templates[edit]
| Class[1] | Default syntax | Preview (default) | Customized syntax | Preview (customized) |
|---|---|---|---|---|
table-rh |
{{rh}} | Row header[2] | Row header | {{rh|align=right}} | Row header | Row header |
| {{rh2}} | Row header[2] | Row header | {{rh2|align=right}} | Row header | Row header | |
table-yes |
{{yes}} | Yes | {{yes|Customized Plain text}} | Customized Plain text |
| {{yes C}} | {{yes C|Customized Plain text}} | |||
| {{yes O}} | {{yes O|Customized Plain text}} | |||
table-maybe |
{{maybe}} | Maybe | {{maybe|Customized Plain text}} | Customized Plain text |
table-no |
{{no}} | No | {{no|Customized Plain text}} | Customized Plain text |
| {{no O}} | {{no O|Customized Plain text}} | |||
| {{no X}} | {{no X|Customized Plain text}} | |||
| {{eliminated}} | Eliminated | {{eliminated|Dropped out}} | Dropped out | |
| {{active fire|12%}} | Active (12%) | |||
| {{lost}} | Lost | {{lost|Missing}} | Missing | |
| {{safe}} | Safe | {{safe|Protected}} | Protected | |
table-active |
{{active}} | Active | {{active|Lively}} | Lively |
table-siteactive |
{{site active}} | Active | {{site active|Up}} | Up |
| {{coming soon}} | Coming soon | {{coming soon|Second half of the year}} | Second half of the year | |
table-siteinactive |
{{site inactive}} | Inactive | {{site inactive|Down}} | Down |
table-yes2 |
{{good}} | Good | {{good|A}} | A |
| {{yes2}} | {{yes2|Text}} | Text | ||
| {{ya}} | {{ya|text=Ya}} | Ya | ||
| {{ya|Ya}} | {{ya|text|link=WP:ALT}} | |||
| {{won}} | Won | {{won|text=white|color=darkblue}} | Won | |
| {{won|place=1}} | 1 | {{won|place=Gold}} | Gold | |
| {{won|place=2}} | 2 | {{won|place=Silver}} | Silver | |
| {{won|place=3}} | 3 | {{won|place=Bronze}} | Bronze | |
| {{WinDL}} | W | {{WinDL|Win}} | Win | |
| {{WinDL|res=D}} | D | {{WinDL|res=Draw}} | Draw | |
| {{WinDL|res=L}} | L | {{WinDL|res=Loss}} | Loss | |
table-no2 |
{{no2}} | {{no2|Text}} | Text | |
| {{na}} | {{na|text=Na}} | Na | ||
| {{na|Na}} | {{na|text|link=WP:ALT}} | |||
| {{nom}} | Nominated | {{nom|5}} | 5 | |
| {{sho}} | Shortlisted | {{sho|Proposed}} | Proposed | |
| {{longlisted}} | Longlisted | {{longlisted|Rejected}} | Rejected | |
| {{TBA}} | TBA | {{TBA|To be announced}} | To be announced | |
| {{BLACK}} | N/A | {{BLACK|Banned}} | Banned | |
table-unknown |
{{unknown}} | Unknown | {{unknown|?}} | ? |
| {{dunno}} | ? | {{dunno|Not sure}} | Not sure | |
table-automatic |
{{perhaps}} | Perhaps | {{perhaps|Customized Plain text}} | Customized Plain text |
table-depends |
{{depends}} | Depends | {{depends|Customized Plain text}} | Customized Plain text |
table-included |
{{included}} | Included | {{included|Incorporated}} | Incorporated |
table-dropped |
{{dropped}} | Dropped | {{dropped|Discontinued}} | Discontinued |
| {{terminated}} | Terminated | {{terminated|Fired}} | Fired | |
table-debate
|
{{D-P}} | P | {{D-P|Present}} | Present |
| {{D-A}} | A | {{D-A|Absent}} | Absent | |
| {{D-I}} | I | {{D-I|Invited}} | Invited | |
| {{D-O}} | O | {{D-O|Invited to other debate}} | Invited to other debate | |
| {{D-N}} | N | {{D-N|Not invited}} | Not invited | |
| {{D-Nv}} | NV | {{D-Nv|Not Voting}} | Not Voting | |
| {{D-W}} | W | {{D-W|Withdrawn}} | Withdrawn | |
| {{D-Out}} | Out | {{D-Out|Out of race}} | Out of race |
Code[edit]
Common code to most if not all the templates in this series:
style="background: #abcdef; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}" class="automatic table-automatic"| {{{1|text}}}
Code specific to this template:
style="background: #F90; color: black; vertical-align: middle; text-align: center; " class="incorrect"|Incorrect
To make a new table cell template you can use:
{{#if:|data-sort-value="<nowiki>{{{sort|</nowiki>{{{sort}}}<nowiki>}}}</nowiki>"}} style="background: background color; color: black; vertical-align: middle; text-align: <nowiki>{{{align|</nowiki>standard horizontal alignment<nowiki>}}}</nowiki>; <nowiki>{{{style|}}}</nowiki>" class="a class name without prefix table-a class name without prefix"| <nowiki>{{{1|</nowiki>default text<nowiki>}}}</nowiki>You should leave out the align parameter and often the class parameter is unnecessary, too.
Add the new template to the table in the common documentation afterwards. Please consider reusing one of the other templates and please choose the color sensibly.
If you find a table cell template that does not take a parameter and you want to be able to change the text in the cell, do not duplicate the template! Instead, edit the template and change the text to a default parameter substitution. For example, if a template's text is Dropped, change that to {{{1|Dropped}}}.
style="background: #abcdef; color: black; vertical-align: middle; text-align: center; " class="automatic table-automatic"| text
TemplateData[edit]
TemplateData for Incorrect
One of several templates for styling individual table cells with standard contents and colors.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| text | 1 | text to be displayed instead of the default, if this doesn't work put the text after the template, possibly with a vertical bar | in between
| Content | optional |
| horizontal align | align | text alignment inside the cell, either 'left', 'right', 'center' or 'justified'
| String | optional |
| style | style | a semicolon separated list of additional CSS rules to be applied to the table cell
| String | optional |
| background color | color | a valid CSS color value or name to override the standard the cell background, only available with some templates
| Line | optional |
See also[edit]
- {{Change}} – calculates, displays and color-codes changes between two values
Notes[edit]
- ↑ The HTML class of table cell templates may be referenced in a user stylesheet to change appearance.
- ↑ a b Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.
| The above documentation is transcluded from Template:Table cell templates/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Subpages of this template. |