[[Category:Template documentation pages{{#translation:}}]]

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. Most of these templates should not be used simply to produce a background color, use them according to their meaning.

For example, <templatestyles src="Template:Nowrap/styles.css"/>{{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.

red-outlined triangle containing exclamation point Important: If you want to use other attributes for the table cells, e.g. colspan, rowspan, or style, they need to be put before the template call, and there must be no vertical bar (aka pipe) | in-between them:

Yes No N/A
Yes/No
...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 style="border:solid 3px Maroon" {{Yes-No}}
...

Templates

Table cell templates
Class[1] Default Customized
Syntax Preview Syntax Preview
table-rh {{rh}} | Row header[2] Row header <templatestyles src="Template:Nowrap/styles.css"/>{{rh|align=right}} | Row header Row header
{{rh2}} | Row header[2] Row header <templatestyles src="Template:Nowrap/styles.css"/>{{rh2|align=center}} | Row header Row header
table-yes {{yes}} Yes <templatestyles src="Template:Nowrap/styles.css"/>{{yes|customized [[plain text|text]]}} customized text
{{yes C}} Yes <templatestyles src="Template:Nowrap/styles.css"/>{{yes C|customized [[plain text|text]]}} customized text
{{yes O}} Yes <templatestyles src="Template:Nowrap/styles.css"/>{{yes O|customized [[plain text|text]]}} customized text
{{yes N}} Yes <templatestyles src="Template:Nowrap/styles.css"/>{{yes N|customized [[plain text|text]]}} customized text
table-maybe {{maybe}} Maybe <templatestyles src="Template:Nowrap/styles.css"/>{{maybe|customized [[plain text|text]]}} customized text
table-no {{no}} No <templatestyles src="Template:Nowrap/styles.css"/>{{no|customized [[plain text|text]]}} customized text
{{no O}} No <templatestyles src="Template:Nowrap/styles.css"/>{{no O|customized [[plain text|text]]}} customized text
{{no X}} No <templatestyles src="Template:Nowrap/styles.css"/>{{no X|customized [[plain text|text]]}} customized text
{{eliminated}} Eliminated <templatestyles src="Template:Nowrap/styles.css"/>{{eliminated|dropped out}} dropped out
{{lost}} Lost <templatestyles src="Template:Nowrap/styles.css"/>{{lost|missing}} missing
<templatestyles src="Template:Nowrap/styles.css"/>{{active fire|12%}}[3] Active <templatestyles src="Template:Nowrap/styles.css"/>(12%)
{{safe}} Safe <templatestyles src="Template:Nowrap/styles.css"/>{{safe|protected}} protected
{{no Y}} No <templatestyles src="Template:Nowrap/styles.css"/>{{no Y|customized [[plain text|text]]}} customized text
table-active {{active}} Active <templatestyles src="Template:Nowrap/styles.css"/>{{active|live}} live
table-siteactive {{site active}} Active <templatestyles src="Template:Nowrap/styles.css"/>{{site active|up}} up
{{coming soon}} Coming soon <templatestyles src="Template:Nowrap/styles.css"/>{{coming soon|second half of the year}} second half of the year
table-siteinactive {{site inactive}} Inactive <templatestyles src="Template:Nowrap/styles.css"/>{{site inactive|down}} down
table-success {{success}} Success <templatestyles src="Template:Nowrap/styles.css"/>{{success|mission complete}} mission complete
{{operational}} Operational <templatestyles src="Template:Nowrap/styles.css"/>{{operational|returning data}} returning data
table-failure {{failure}} Failure <templatestyles src="Template:Nowrap/styles.css"/>{{failure|wrong orbit}} wrong orbit
table-yes2 {{yes2}} <templatestyles src="Template:Nowrap/styles.css"/>{{yes2|text}} text
{{good}} Good <templatestyles src="Template:Nowrap/styles.css"/>{{good|A}} A
{{ya}} Yes <templatestyles src="Template:Nowrap/styles.css"/>{{ya|text=ya}} ya
<templatestyles src="Template:Nowrap/styles.css"/>{{ya|Ya}} Ya <templatestyles src="Template:Nowrap/styles.css"/>{{ya|text|link=WP:ALT}} text
{{yan}} Yes <templatestyles src="Template:Nowrap/styles.css"/>{{yan|text=ya}} ya
{{won}} Won <templatestyles src="Template:Nowrap/styles.css"/>{{won|text=white|color=darkblue|winner}} winner
<templatestyles src="Template:Nowrap/styles.css"/>{{won|place=1}} 1 <templatestyles src="Template:Nowrap/styles.css"/>{{won|place=gold}} gold
<templatestyles src="Template:Nowrap/styles.css"/>{{won|place=2}} 2 <templatestyles src="Template:Nowrap/styles.css"/>{{won|place=silver}} silver
<templatestyles src="Template:Nowrap/styles.css"/>{{won|place=3}} 3 <templatestyles src="Template:Nowrap/styles.css"/>{{won|place=bronze}} bronze
{{WinDL}} W <templatestyles src="Template:Nowrap/styles.css"/>{{WinDL|win}} win
<templatestyles src="Template:Nowrap/styles.css"/>{{WinDL|res=D}} D <templatestyles src="Template:Nowrap/styles.css"/>{{WinDL|res=draw}} draw
<templatestyles src="Template:Nowrap/styles.css"/>{{WinDL|res=L}} L <templatestyles src="Template:Nowrap/styles.css"/>{{WinDL|res=loss}} loss
table-no2 {{no2}} <templatestyles src="Template:Nowrap/styles.css"/>{{no2|text}} text
{{na}} No <templatestyles src="Template:Nowrap/styles.css"/>{{na|text=na}} na
<templatestyles src="Template:Nowrap/styles.css"/>{{na|Na}} Na <templatestyles src="Template:Nowrap/styles.css"/>{{na|text|link=WP:ALT}} text
{{nan}} No <templatestyles src="Template:Nowrap/styles.css"/>{{nan|text=na}} na
{{nom}} Nominated <templatestyles src="Template:Nowrap/styles.css"/>{{nom|5}} 5
{{notnom}} Not nominated {{notnom}} not selected
{{sho}} Shortlisted <templatestyles src="Template:Nowrap/styles.css"/>{{sho|proposed}} proposed
{{longlisted}} Longlisted <templatestyles src="Template:Nowrap/styles.css"/>{{longlisted|rejected}} rejected
{{TBA}} TBA <templatestyles src="Template:Nowrap/styles.css"/>{{TBA|to be announced}} to be announced
table-partial {{partial}} Partial <templatestyles src="Template:Nowrap/styles.css"/>{{partial|almost done}} almost done
{{Regional}} Regional <templatestyles src="Template:Nowrap/styles.css"/>{{Regional|Uyghur}} Uyghur
{{MaybeCheck}} Maybe <templatestyles src="Template:Nowrap/styles.css"/>{{MaybeCheck|text=possibly}} possibly
<templatestyles src="Template:Nowrap/styles.css"/>{{MaybeCheck|possibly}} possibly <templatestyles src="Template:Nowrap/styles.css"/>{{MaybeCheck|text|link=WP:ALT}} text
{{partial success}} Partial success <templatestyles src="Template:Nowrap/styles.css"/>{{partial success|
reached orbit and returned pictures}}
reached orbit and returned pictures
{{partial failure}} Partial failure <templatestyles src="Template:Nowrap/styles.css"/>{{partial failure|[[Cubesat]] not deployed}} Cubesat not deployed
{{okay}} Neutral <templatestyles src="Template:Nowrap/styles.css"/>{{okay|C}} C
{{Yes-No}} Yes/No <templatestyles src="Template:Nowrap/styles.css"/>{{Yes-No|yes with an if; no with a but}} yes with an if; no with a but
{{some}} Some <templatestyles src="Template:Nowrap/styles.css"/>{{some|many}} many
{{pending}} Pending <templatestyles src="Template:Nowrap/styles.css"/>{{pending|awaiting}} awaiting
{{sometimes}} Sometimes <templatestyles src="Template:Nowrap/styles.css"/>{{sometimes|occasionally}} occasionally
{{rarely}} Rarely <templatestyles src="Template:Nowrap/styles.css"/>{{rarely|seldom}} seldom
{{usually}} Usually <templatestyles src="Template:Nowrap/styles.css"/>{{usually|commonly}} commonly
{{unofficial}} Unofficial <templatestyles src="Template:Nowrap/styles.css"/>{{unofficial|''de facto''}} de facto
{{unofficial2}} Unofficial <templatestyles src="Template:Nowrap/styles.css"/>{{unofficial2|''de facto''}} de facto
{{nonpartisan}} Nonpartisan <templatestyles src="Template:Nowrap/styles.css"/>{{nonpartisan|impartial}} impartial
table-any {{any}} Any <templatestyles src="Template:Nowrap/styles.css"/>{{any|anyone}} anyone
table-automatic {{perhaps}} Perhaps <templatestyles src="Template:Nowrap/styles.css"/>{{perhaps|maybe}} maybe
table-draw {{draw}} <templatestyles src="Template:Nowrap/styles.css"/>{{draw|1:1}} 1:1
table-noAttempt {{No attempt}} No attempt <templatestyles src="Template:Nowrap/styles.css"/>{{No attempt|No landing attempted}} No landing attempted
table-na {{n/a}} N/A <templatestyles src="Template:Nowrap/styles.css"/>{{n/a|unavailable}} unavailable
{{varies}} Varies <templatestyles src="Template:Nowrap/styles.css"/>{{varies|differs}} differs
{{non-album single}}[4] Non-album single <templatestyles src="Template:Nowrap/styles.css"/>{{non-album single|EP}} Non-album single
{{unreleased}} Unreleased <templatestyles src="Template:Nowrap/styles.css"/>{{unreleased|shelved}} shelved
{{BLACK}} N/A <templatestyles src="Template:Nowrap/styles.css"/>{{BLACK|banned}} banned
{{sdash}} <templatestyles src="Template:Nowrap/styles.css"/>{{sdash|[[File:Dash.svg|13px|dash icon]]}} dash
{{vacant}} Vac­ant <templatestyles src="Template:Nowrap/styles.css"/>{{vacant|missing}} missing
table-unknown {{unknown}} Un­known <templatestyles src="Template:Nowrap/styles.css"/>{{unknown|?}} ?
{{dunno}} ? <templatestyles src="Template:Nowrap/styles.css"/>{{dunno|not sure}} not sure
table-included {{included}} Included <templatestyles src="Template:Nowrap/styles.css"/>{{included|incorporated}} incorporated
noresult {{no result}} No result <templatestyles src="Template:Nowrap/styles.css"/>{{no result|NR}} NR
table-planned {{planned}} Planned <templatestyles src="Template:Nowrap/styles.css"/>{{planned|July 2028}} July 2028
table-scheduled {{scheduled}} Scheduled <templatestyles src="Template:Nowrap/styles.css"/>{{scheduled|3 March 2027}} 3 March 2027
table-software[5] {{beta}} Beta <templatestyles src="Template:Nowrap/styles.css"/>{{beta|preview}} preview
{{table-experimental}} Experimental <templatestyles src="Template:Nowrap/styles.css"/>{{table-experimental|lab}} lab
{{nightly}} Nightly build <templatestyles src="Template:Nowrap/styles.css"/>{{nightly|dev}} dev
{{release-candidate}} Release candidate <templatestyles src="Template:Nowrap/styles.css"/>{{release-candidate|RC}} RC
{{open source}} Open source <templatestyles src="Template:Nowrap/styles.css"/>{{open source|software libre}} software libre
{{free}} Free <templatestyles src="Template:Nowrap/styles.css"/>{{free|empty}} empty
{{proprietary}} Proprietary <templatestyles src="Template:Nowrap/styles.css"/>{{proprietary|custom extension}} custom extension
{{nonfree}} Non-free <templatestyles src="Template:Nowrap/styles.css"/>{{nonfree|paid}} paid
{{needs}} Needs <templatestyles src="Template:Nowrap/styles.css"/>{{needs|req.}} req.
table-depends {{depends}} Depends <templatestyles src="Template:Nowrap/styles.css"/>{{depends|vendor-defined}} vendor-defined
table-dropped {{dropped}} Dropped <templatestyles src="Template:Nowrap/styles.css"/>{{dropped|discontinued}} discontinued
{{terminated}} Terminated <templatestyles src="Template:Nowrap/styles.css"/>{{terminated|fired}} fired
incorrect {{incorrect}} Incorrect <templatestyles src="Template:Nowrap/styles.css"/>{{incorrect|wrong}} wrong
table-debate {{D-P}} P <templatestyles src="Template:Nowrap/styles.css"/>{{D-P|present}} present
{{D-A}} A <templatestyles src="Template:Nowrap/styles.css"/>{{D-A|absent}} absent
{{D-I}} I <templatestyles src="Template:Nowrap/styles.css"/>{{D-I|invited}} invited
{{D-O}} O <templatestyles src="Template:Nowrap/styles.css"/>{{D-O|invited to other debate}} invited to other debate
{{D-N}} N <templatestyles src="Template:Nowrap/styles.css"/>{{D-N|not invited}} not invited
{{D-Nv}} NV <templatestyles src="Template:Nowrap/styles.css"/>{{D-Nv|not voting}} not voting
{{D-W}} W <templatestyles src="Template:Nowrap/styles.css"/>{{D-W|withdrawn}} withdrawn
{{D-Out}} Out <templatestyles src="Template:Nowrap/styles.css"/>{{D-Out|out of race}} out of race
table-cast[6] {{CMain}} Main <templatestyles src="Template:Nowrap/styles.css"/>{{CMain|text}} text
{{CAlso starring}} Also starring <templatestyles src="Template:Nowrap/styles.css"/>{{CAlso starring|costar}} costar
{{CRecurring}} Recurring <templatestyles src="Template:Nowrap/styles.css"/>{{CRecurring|regular guest}} regular guest
{{CGuest}} Guest <templatestyles src="Template:Nowrap/styles.css"/>{{CGuest|victim}} victim
{{COther}} Does not appear <templatestyles src="Template:Nowrap/styles.css"/>{{COther|ensemble}} ensemble
{{CNone}} Does not appear <templatestyles src="Template:Nowrap/styles.css"/>{{CNone|cast}} cast
{{CEmpty}}
{{CRemoved}} removed <templatestyles src="Template:Nowrap/styles.css"/>{{CRemoved|edited}} edited
{{CFinalist}} Finalist <templatestyles src="Template:Nowrap/styles.css"/>{{CFinalist|contender}} contender
<templatestyles src="Template:Nowrap/styles.css"/>{{CFinalist|place=3rd Place}} 3rd Place <templatestyles src="Template:Nowrap/styles.css"/>{{CFinalist|place=third place}} third place
{{exempt}} exempt <templatestyles src="Template:Nowrap/styles.css"/>{{Black Exempt}} B.Exempt
{{nocontest}} <templatestyles src="Template:Nowrap/styles.css"/>{{nocontest|rescheduled}} rescheduled
{{Runner-up}} Runner-up <templatestyles src="Template:Nowrap/styles.css"/>{{Runner-up|2nd Place}} 2nd Place
{{Quit}} Quit <templatestyles src="Template:Nowrap/styles.css"/>{{Quit|left}} left
no class {{not yet}} Not yet <templatestyles src="Template:Nowrap/styles.css"/>{{not yet|NY}} NY
{{optional}} Optional <templatestyles src="Template:Nowrap/styles.css"/>{{optional|non-mandatory}} non-mandatory
<templatestyles src="Template:Nowrap/styles.css"/>{{shade|100}}% 100% <templatestyles src="Template:Nowrap/styles.css"/>{{shade|color=blue|100}}% 100%
<templatestyles src="Template:Nowrap/styles.css"/>{{shade|75}}% 75% <templatestyles src="Template:Nowrap/styles.css"/>{{shade|color=blue|75|73–78}}% 73–78%
<templatestyles src="Template:Nowrap/styles.css"/>{{shade|25}}% 25% <templatestyles src="Template:Nowrap/styles.css"/>{{shade|color=blue|25|{{val|25|2|u=%}}}} 25%±2%
<templatestyles src="Template:Nowrap/styles.css"/>{{shade|0}}% 0% <templatestyles src="Template:Nowrap/styles.css"/>{{shade|color=blue|0}}% 0%
<templatestyles src="Template:Nowrap/styles.css"/>{{ColorCell}} <templatestyles src="Template:Nowrap/styles.css"/>{{ColorCell|Blank}} Blank
<templatestyles src="Template:Nowrap/styles.css"/>{{ColorCell|type=lred}} <templatestyles src="Template:Nowrap/styles.css"/>{{ColorCell|type=lred|Red}} Red
<templatestyles src="Template:Nowrap/styles.css"/>{{ColorCell|type=lgreen}} <templatestyles src="Template:Nowrap/styles.css"/>{{ColorCell|type=lgreen|Green}} Green

Code

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|text-transform: capitalize;}}}" class="automatic table-automatic"| {{{1|text}}}


Creating new templates

To make a new table cell template you can use:

{{subst:Table cell templates|text= default text |bg= background color |class= a class name without prefix |align= standard horizontal alignment}}

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: {{{align|center}}}; {{{style|}}}" class="automatic table-automatic"| {{{1|text}}}

Choosing a color

When changing or creating a new template, follow the use of colour guidelines and the color accessibility guidelines when choosing the background color and, sometimes, the text color. Many of these templates can be used with links to other articles or references, so the links should be clearly identifiable against the background color. You can check contrast level using the WebAIM contrast checker by setting the foreground color to the blue link color. Contrast should be at the minimum WCAG AA level and, whenever possible, at WCAG AAA level. Wikipedia:Manual of Style/Accessibility/Colors has a set of colors that comply with WCAG AAA and WCAG AA for unvisited links and normal text.

Color subpage

All templates should either have a /bgcolor subpage that contains nothing but a valid CSS color code, possibly wrapped in nowiki tags, e.g. #BFD, which can be included with background: {{/bgcolor}}; in the style attribute, or they should reference another template's subpage, e.g. background: {{Template:Yes2/bgcolor}};. Alternatively, the /bgcolor subpage may redirect to another color code subpage: #REDIRECT [[yes2/bgcolor]].

This way, pages that are using these templates may also use {{legend}} and similar templates which can reference the actual color: {{legend|{{yes2/bgcolor}}|supported}}

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Table cell templates

[[Category:TemplateData documentation{{#translation:}}]]

<templatedata> { "description": "One of several templates for styling individual table cells with standard contents and colors.", "format": "inline", "params": { "1": { "label": "text", "description": "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", "type": "content", "default": "(template dependent)", "required": false,

           "suggested": false

}, "align": { "label": "horizontal align", "description": "text alignment inside the cell, either 'left', 'right', 'center' or 'justified'", "default": "center", "inherits": "1", "type": "string",

           "suggested": false,

"suggestedvalues": [ "left", "center",

       		"right",
       		"justified"

] }, "style": { "label": "style", "description": "a semicolon-separated list of additional CSS rules to be applied to the table cell", "inherits": "1", "type": "string",

           "suggested": false

}, "color": { "label": "background color", "description": "a valid CSS color value or name to override the standard cell background, only available with some templates", "inherits": "1", "type": "line",

           "suggested": false

} } } </templatedata>

See also

  • {{Change}} – calculates, displays and color-codes changes between two values
  • {{BSD-lic}} – specialized redirect for <templatestyles src="Template:Nowrap/styles.css"/>{{free}}
  • {{GPL-lic}} – specialized redirect for <templatestyles src="Template:Nowrap/styles.css"/>{{free}}
  • {{LGPL-lic}} – specialized redirect for <templatestyles src="Template:Nowrap/styles.css"/>{{free}}
  • {{Active}} / {{No result}} / {{Eliminated}} for comparison tables

Notes

  1. The HTML class of table cell templates may be referenced in a user stylesheet to change appearance.
  2. 2.0 2.1 Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.
  3. This template is related to WikiProject Wildfire.
  4. This template is related to WikiProject Songs.
  5. This group of templates is related to WikiProject Software.
  6. This group of templates is related to WikiProject Television.