Template:Table cell templates/doc: Difference between revisions

Template page
No edit summary
No edit summary
 
Line 10: Line 10:
{| class="punishers"
{| class="punishers"
|-
|-
! Template !! Preview (default) !! Customized syntax !! Preview (customized)
! Template !! Preview !! Custom text !! Preview
|-
|-
| {{tl|yes}} || {{yes}} || <nowiki>{{yes|customized text}}</nowiki> || {{yes|customized text}}
| {{tl|yes}} || {{yes}} || <nowiki>{{yes|foo bar}}</nowiki> || {{yes|foo bar}}
|-
|-
| {{tl|ya}} || {{ya}} || <nowiki>{{ya|customized text}}</nowiki> || {{ya|customized text}}
| {{tl|ya}} || {{ya}} || <nowiki>{{ya|foo bar}}</nowiki> || {{ya|foo bar}}
|-
|-
| {{tl|no}} || {{no}} || <nowiki>{{no|customized text}}</nowiki> || {{no|customized text}}
| {{tl|no}} || {{no}} || <nowiki>{{no|foo bar}}</nowiki> || {{no|foo bar}}
|-
|-
| {{tl|na}} || {{na}} || <nowiki>{{na|customized text}}</nowiki> || {{na|customized text}}
| {{tl|na}} || {{na}} || <nowiki>{{na|foo bar}}</nowiki> || {{na|foo bar}}
|-
|-
| {{tl|maybe}} || {{maybe}} || <nowiki>{{maybe|customized text}}</nowiki> || {{maybe|customized text}}
| {{tl|maybe}} || {{maybe}} || <nowiki>{{maybe|foo bar}}</nowiki> || {{maybe|foo bar}}
|-
|-
| {{tl|eh}} || {{eh}} || <nowiki>{{eh|customized text}}</nowiki> || {{eh|customized text}}
| {{tl|eh}} || {{eh}} || <nowiki>{{eh|foo bar}}</nowiki> || {{eh|foo bar}}
|}
|}


Line 30: Line 30:
{| class="wikitable"
{| class="wikitable"
|-
|-
| {{Yes}} || {{No}}
| {{Yes}} || {{No}} || rowspan="2" {{Na}}
|-
|-
| colspan="2" {{Maybe}}
| colspan="2" {{Maybe}}
Line 40: Line 40:
{| class="wikitable"
{| class="wikitable"
|-
|-
| {{Yes}} || {{No}}
| {{Yes}} || {{No}} || rowspan="2" {{Na}}
|-
|-
| colspan="2" {{Maybe}}
| colspan="2" {{Maybe}}
|}
|}

Latest revision as of 14:04, 7 February 2022

The templates in this series are designed to be used in a table to make a cell with appropriate text and colored background, primarily for comparison tables. These templates should not be used simply to produce a background color in other contexts. Use the appropriate classes for that instead.

As an example, {{yes}} makes a cell with a green background and the text "Yes". The text can be changed, e.g. {{yes|Sure}} would output "Sure". Other parameters that work are align and style.

If you want to change other attributes, e.g. the rowspan, make sure there's no | character before the template, e.g. write rowspan="2" {{yes}} and not rowspan="2" | {{yes}}.

Templates

Template Preview Custom text Preview
{{yes}} Yes {{yes|foo bar}} foo bar
{{ya}} ✔︎ {{ya|foo bar}} ✔︎ foo bar
{{no}} No {{no|foo bar}} foo bar
{{na}} ✘︎ {{na|foo bar}} ✘︎ foo bar
{{maybe}} Maybe {{maybe|foo bar}} foo bar
{{eh}} ≈︎ {{eh|foo bar}} ≈︎ foo bar

Usage

{| class="wikitable"
|-
| {{Yes}} || {{No}} || rowspan="2" {{Na}}
|-
| colspan="2" {{Maybe}}
|}

Example

Yes No ✘︎
Maybe