Template:Yes

From Wikidata
Jump to navigation Jump to search
Yes
Documentation icon Template documentation[view · edit · history · purge ]

Templates like this one, {{Yes}}, are designed to generate a uniform appearance in wikitables that display a lot of predefined values, where the use of identical typeface, color and padding help to keep its appearance tidy and the information easy to parse. They make a cell with their page name as the text in that cell, with an appropriately colored background.

Usage[edit]

{{Yes}} makes a cell with a green background, where the text in the cell (which defaults to 'Yes' when there are no parameters supplied) is taken from the first unnamed parameter; {{Yes|Sure}} would output a table cell with 'Sure' in it, instead of 'Yes'.

Yes No N/A
Yes/No
…
 ! {{Yes}} || {{No}} || rowspan="2" {{N/a|style=font-size: larger;}}
 |-
 | colspan="2" {{Yes-No|style=border-top: 3px solid Maroon;}}

Choosing a color[edit]

If you opt to customize a call to this template, follow the use of color and color accessibility guidelines when choosing the background and/or text colors. Many of these templates can be used with links to other items or properties, so the links should be clearly identifiable against the background color. You can check the contrast level using the WebAIM contrast checker by setting the foreground color to the blue link color. Contrast should be at the WCAG AA level at a minimum, and whenever possible, at the WCAG AAA level. English Wikipedia's Manual of Style has a set of colors that comply with WCAG AAA and WCAG AA for unvisited links and normal text.

TemplateData[edit]

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

Yes

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

Template parameters[Edit template data]

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Cell contents1

The text to be displayed in the cell instead of its name; if this doesn't work, put the text after the template, possibly with a vertical bar (a/k/a pipe) | in between

Example
Whatever
Stringoptional
Background colorcolor

A valid CSS3 color value or name to override the default cell background, only available with some templates

Example
Firebrick
Lineoptional
Horizontal alignmentalign

The alignment of the contents inside the cell, either 'left', 'right', 'center' or 'justified'

Suggested values
left center right justified
Default
center
Example
center
Lineoptional
Inline CSSstyle

A semicolon-delimited list of additional CSS3 declarations to be applied to the table cell

Example
font-weight: 600;
Lineoptional

See also[edit]

Other members of this template family
Class[1] Default Customized
Syntax Preview Syntax Preview
table-yes {{Yes}} Yes {{Yes|customized text}} customized text
table-maybe {{Maybe}} Partial {{Maybe|customized text}} customized text
table-no {{No}} No {{No|customized text}} customized text
table-yes2 {{Ya}} Yes {{Ya|text=Ya}} Ya
{{Ya|link=wikipedia:WP:ALT}} Yes
table-no2 {{Na}} No {{Na|text=Na}} Na
{{Na|link=wikipedia:WP:ALT}} No
table-partial {{Partial}} Partial {{Partial|almost done}} almost done
{{Partial success}} Partial success {{Partial success|couldn't maintain orbit}} couldn't maintain orbit
{{Yes-No}} Yes/No {{Yes-No|yes with an if; no with a but}} yes with an if; no with a but
table-na {{N/a}} N/A {{N/a|Unavailable}} Unavailable
  1. The HTML class of table cell templates may be referenced in a user stylesheet to change their appearance.