Template:Yes
Yes |
This template is used on many pages, and changes to it will be widely noticed. Please test any changes in the template's /sandbox or /testcases subpages, or in a user subpage, and consider discussing changes at the talk page before implementing them. |
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'.
If you want to define other attributes for the cell, e.g. colspan, rowspan or data-sort-type, they need to be put before the template call and there must be no vertical bar (a/k/a pipe) (| ) in-between them. Similarly, any additional inline CSS3 properties you wish to define must be passed to the template's |style= parameter; their presence when preceding the template call wipes out all of its default formatting. |
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]One of several templates for styling individual table cells with standard contents and colors
Parameter | Description | Type | Status | |
---|---|---|---|---|
Cell contents | 1 | 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
| String | optional |
Background color | color | A valid CSS3 color value or name to override the default cell background, only available with some templates
| Line | optional |
Horizontal alignment | align | The alignment of the contents inside the cell, either 'left', 'right', 'center' or 'justified'
| Line | optional |
Inline CSS | style | A semicolon-delimited list of additional CSS3 declarations to be applied to the table cell
| Line | optional |
See also
[edit]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}} | {{Ya|text=Ya}} | Ya | |
{{Ya|link=wikipedia:WP:ALT}} | ||||
table-no2
|
{{Na}} | {{Na|text=Na}} | Na | |
{{Na|link=wikipedia:WP:ALT}} | ||||
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 |
- ↑ The HTML class of table cell templates may be referenced in a user stylesheet to change their appearance.
The above documentation is transcluded from Template:Yes/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |