Template:Table cell templates/doc

From blackwiki
Jump to navigation Jump to search

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

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

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 for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template based on this TemplateData.

TemplateData for Table cell templates

Unexpected property "params.align.suggestedvalues".

See also

  • {{Change}} – calculates, displays and color-codes changes between two values
  • {{BSD-lic}} – specialized redirect for Script error: No such module "Template link general".
  • {{GPL-lic}} – specialized redirect for Script error: No such module "Template link general".
  • {{LGPL-lic}} – specialized redirect for Script error: No such module "Template link general".

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.