Plantilla:Table cell templates/doc

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.

⚠ Important: 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

revisa
Table cell templates
Class[1] Default syntax Preview (default) Customized syntax Preview (customized)
table-rh {{rh}} | Row header[2] Plantilla:Rh | Row header {{rh|align=right}} | Row header Plantilla:Rh | Row header
{{rh2}} | Row header[2] Plantilla:Rh2 | Row header {{rh2|align=right}} | Row header Plantilla:Rh2 | Row header
table-yes {{yes}} Yes {{yes|customized [[plain text|text]]}} customized text
{{yes C}} Plantilla:Yes C {{yes C|}} Plantilla:Yes C
{{yes O}} Plantilla:Yes O {{yes O|}} Plantilla:Yes O
table-maybe {{maybe}} Maybe {{maybe|customized [[plain text|text]]}} customized text
table-no {{no}} No {{no|customized [[plain text|text]]}} customized text
{{no O}} Plantilla:No O {{no O|}} Plantilla:No O
{{no X}} Plantilla:No X {{no X|}} Plantilla:No X
{{eliminated}} Plantilla:Eliminated {{eliminated|dropped out}} Plantilla:Eliminated
{{active fire|12%}} Plantilla:Active fire
{{lost}} Plantilla:Lost {{lost|missing}} Plantilla:Lost
{{safe}} Plantilla:Safe {{safe|protected}} Plantilla:Safe
table-active {{active}} Plantilla:Active {{active|live}} Plantilla:Active
table-siteactive {{site active}} Plantilla:Site active {{site active|up}} Plantilla:Site active
{{coming soon}} Plantilla:Coming soon {{coming soon|second half of the year}} Plantilla:Coming soon
table-siteinactive {{site inactive}} Plantilla:Site inactive {{site inactive|down}} Plantilla:Site inactive
table-yes2 {{good}} Plantilla:Good {{good|A}} Plantilla:Good
{{yes2}} Plantilla:Yes2 {{yes2|text}} Plantilla:Yes2
{{ya}} Yes {{ya|text=ya}} ya
{{ya|Ya}} Ya {{ya|text|link=WP:ALT}} text
{{won}} Plantilla:Won {{won|text=white|color=darkblue|winner}} Plantilla:Won
{{won|place=1}} Plantilla:Won {{won|place=gold}} Plantilla:Won
{{won|place=2}} Plantilla:Won {{won|place=silver}} Plantilla:Won
{{won|place=3}} Plantilla:Won {{won|place=bronze}} Plantilla:Won
{{WinDL}} Plantilla:WinDL {{WinDL|win}} Plantilla:WinDL
{{WinDL|res=D}} Plantilla:WinDL {{WinDL|res=draw}} Plantilla:WinDL
{{WinDL|res=L}} Plantilla:WinDL {{WinDL|res=loss}} Plantilla:WinDL
table-no2 {{no2}} Plantilla:No2 {{no2|text}} Plantilla:No2
{{na}} Plantilla:Na {{na|text=na}} Plantilla:Na
{{na|Na}} Plantilla:Na {{na|text|link=WP:ALT}} Plantilla:Na
{{nom}} Plantilla:Nom {{nom|5}} Plantilla:Nom
{{sho}} Plantilla:Sho {{sho|proposed}} Plantilla:Sho
{{longlisted}} Plantilla:Longlisted {{longlisted|rejected}} Plantilla:Longlisted
{{TBA}} Plantilla:TBA {{TBA|to be announced}} Plantilla:TBA
table-success {{success}} Plantilla:Success {{success|mission complete}} Plantilla:Success
{{operational}} Plantilla:Operational {{operational|returning data}} Plantilla:Operational
table-failure {{failure}} Plantilla:Failure {{failure|wrong orbit}} Plantilla:Failure
table-partial {{partial}} Plantilla:Partial {{partial|almost done}} Plantilla:Partial
{{Regional}} Plantilla:Regional {{Regional|Uyghur}} Plantilla:Regional
{{MaybeCheck}} Plantilla:MaybeCheck {{MaybeCheck|text=possibly}} Plantilla:MaybeCheck
{{MaybeCheck|possibly}} Plantilla:MaybeCheck {{MaybeCheck|text|link=WP:ALT}} Plantilla:MaybeCheck
{{partial success}} Plantilla:Partial success {{partial success|reached orbit and returned pictures}} Plantilla:Partial success
{{partial failure}} Plantilla:Partial failure {{partial failure|[[Cubesat]] not deployed}} Plantilla:Partial failure
{{okay}} Plantilla:Okay {{okay|C}} Plantilla:Okay
{{Yes-No}} Yes/No {{Yes-No|yes with an if; no with a but}} yes with an if; no with a but
{{some}} Plantilla:Some {{some|many}} Plantilla:Some
{{nonpartisan}} Plantilla:Nonpartisan {{nonpartisan|impartial}} Plantilla:Nonpartisan
{{pending}} Plantilla:Pending {{pending|awaiting}} Plantilla:Pending
{{unofficial}} Plantilla:Unofficial {{unofficial|''de facto''}} Plantilla:Unofficial
{{unofficial2}} Plantilla:Unofficial2 {{unofficial2|''de facto''}} Plantilla:Unofficial2
{{usually}} Plantilla:Usually {{usually|commonly}} Plantilla:Usually
{{rarely}} Plantilla:Rarely {{rarely|seldom}} Plantilla:Rarely
{{sometimes}} Plantilla:Sometimes {{sometimes|occasionally}} Plantilla:Sometimes
table-noAttempt {{No attempt}} Plantilla:No attempt {{No attempt|No landing attempted}} Plantilla:No attempt
table-any {{any}} Plantilla:Any {{any|anyone}} Plantilla:Any
table-na {{n/a}} N/A {{n/a|unavailable}} unavailable
{{varies}} Plantilla:Varies {{varies|differs}} Plantilla:Varies
{{sdash}} Plantilla:Sdash {{sdash|[[File:Dash.svg|13px|link=|dash icon]]}} Plantilla:Sdash
{{BLACK}} Plantilla:BLACK {{BLACK|banned}} Plantilla:BLACK
{{non-album single}} Plantilla:Non-album single {{non-album single|EP}} Plantilla:Non-album single
{{unreleased}} Plantilla:Unreleased {{unreleased|shelved}} Plantilla:Unreleased
table-unknown {{unknown}} Plantilla:Unknown {{unknown|?}} Plantilla:Unknown
{{dunno}} Plantilla:Dunno {{dunno|not sure}} Plantilla:Dunno
table-automatic {{perhaps}} Plantilla:Perhaps {{perhaps|maybe}} Plantilla:Perhaps
table-depends {{depends}} Plantilla:Depends {{depends|vendor-defined}} Plantilla:Depends
table-included {{included}} Plantilla:Included {{included|incorporated}} Plantilla:Included
table-dropped {{dropped}} Plantilla:Dropped {{dropped|discontinued}} Plantilla:Dropped
{{terminated}} Plantilla:Terminated {{terminated|fired}} Plantilla:Terminated
table-beta {{beta}} Plantilla:Beta {{beta|preview}} Plantilla:Beta
table-experimental {{table-experimental}} Plantilla:Table-experimental {{table-experimental|lab}} Plantilla:Table-experimental
table-free {{free}} Plantilla:Free {{free|empty}} Plantilla:Free
table-proprietary {{proprietary}} Plantilla:Proprietary {{proprietary|custom extension}} Plantilla:Proprietary
table-nonfree {{nonfree}} Plantilla:Nonfree {{nonfree|paid}} Plantilla:Nonfree
table-needs {{needs}} Plantilla:Needs {{needs|req.}} Plantilla:Needs
table-nightly {{nightly}} Plantilla:Nightly {{nightly|dev}} Plantilla:Nightly
table-release-candidate {{release-candidate}} Plantilla:Release-candidate {{release-candidate|RC}} Plantilla:Release-candidate
table-draw {{draw}} Plantilla:Draw {{draw|1:1}} Plantilla:Draw
table-planned {{planned}} Plantilla:Planned {{planned|July 2028}} Plantilla:Planned
table-scheduled {{scheduled}} Plantilla:Scheduled {{scheduled|3 March 2027}} Plantilla:Scheduled
incorrect {{incorrect}} Plantilla:Incorrect {{incorrect|wrong}} Plantilla:Incorrect
noresult {{no result}} Plantilla:No result {{no result|NR}} Plantilla:No result
table-debate {{D-P}} Plantilla:D-P {{D-P|present}} Plantilla:D-P
{{D-A}} Plantilla:D-A {{D-A|absent}} Plantilla:D-A
{{D-I}} Plantilla:D-I {{D-I|invited}} Plantilla:D-I
{{D-O}} Plantilla:D-O {{D-O|invited to other debate}} Plantilla:D-O
{{D-N}} Plantilla:D-N {{D-N|not invited}} Plantilla:D-N
{{D-Nv}} Plantilla:D-Nv {{D-Nv|not voting}} Plantilla:D-Nv
{{D-W}} Plantilla:D-W {{D-W|withdrawn}} Plantilla:D-W
{{D-Out}} Plantilla:D-Out {{D-Out|out of race}} Plantilla:D-Out
table-cast {{CMain}} Plantilla:CMain {{CMain|text}} Plantilla:CMain
{{CAlso starring}} Plantilla:CAlso starring {{CAlso starring|costar}} Plantilla:CAlso starring
{{CRecurring}} Plantilla:CRecurring {{CRecurring|regular guest}} Plantilla:CRecurring
{{CGuest}} Plantilla:CGuest {{CGuest|victim}} Plantilla:CGuest
{{COther}} Plantilla:COther {{COther|ensemble}} Plantilla:COther
{{CNone}} Plantilla:CNone {{CNone|cast}} Plantilla:CNone
{{CEmpty}} Plantilla:CEmpty
{{CRemoved}} Plantilla:CRemoved {{CRemoved|edited}} Plantilla:CRemoved
{{CFinalist}} Plantilla:CFinalist {{CFinalist|text=white|color=darkblue|contender}} Plantilla:CFinalist
{{CFinalist|place=3rd Place}} Plantilla:CFinalist {{CFinalist|place=third place}} Plantilla:CFinalist
{{exempt}} Plantilla:Exempt {{Black Exempt}} Plantilla:Black Exempt
{{nocontest}} Plantilla:Nocontest {{nocontest|rescheduled}} Plantilla:Nocontest
{{Runner-up}} Plantilla:Runner-up {{Runner-up|2nd place}} Plantilla:Runner-up
{{Quit}} Plantilla:Quit {{Quit|left}} Plantilla:Quit
no class {{not yet}} Plantilla:Not yet {{not yet|NY}} Plantilla:Not yet
{{optional}} Plantilla:Optional {{optional|non-mandatory}} Plantilla:Optional
{{shade|25}}% Plantilla:Shade% {{shade|75}}% Plantilla:Shade%

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

revisa

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}}}

Color subpage

revisa

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

revisa
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.

TemplateData for Table cell templates

One of several templates for styling individual table cells with standard contents and colors.

Parámetros de la plantilla

Es preferible escribir los parámetros en una sola línea.

ParámetroDescripciónTipoEstado
text1

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

Predeterminado
(template dependent)
Contenidoopcional
horizontal alignalign

text alignment inside the cell, either 'left', 'right', 'center' or 'justified'

Predeterminado
center
Cadenaopcional
stylestyle

a semicolon separated list of additional CSS rules to be applied to the table cell

Predeterminado
(template dependent)
Cadenaopcional
background colorcolor

a valid CSS color value or name to override the standard the cell background, only available with some templates

Predeterminado
(template dependent)
Líneaopcional

See also

revisa
  • {{Change}} – calculates, displays and color-codes changes between two values
  • {{BSD-lic}} – specialized redirect for {{free}}
  • {{GPL-lic}} – specialized redirect for {{free}}
  • {{LGPL-lic}} – specialized redirect for {{free}}
  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.