Template:Unknown/doc: Difference between revisions
RogueScholar (talk | contribs) (Relocate template documentation to dedicated subpage to save on parsing time) |
RogueScholar (talk | contribs) (Simplify syntax of the bgcolor parameter) |
||
Line 44: | Line 44: | ||
<td>'''<kbd>left</kbd>''' or '''<kbd>right</kbd>''' align the cell contents to that horizontal edge, overriding the default center alignment</td></tr> | <td>'''<kbd>left</kbd>''' or '''<kbd>right</kbd>''' align the cell contents to that horizontal edge, overriding the default center alignment</td></tr> | ||
<tr><th><code><nowiki>bgcolor</nowiki></code></th> | <tr><th><code><nowiki>bgcolor</nowiki></code></th> | ||
<td>changes the background color | <td>changes the background color — values may be: | ||
* | * keywords like '''<kbd>transparent</kbd>''' or '''<kbd>none</kbd>''' (inheriting the surrounding background color or becoming white, respectively) | ||
* | * named CSS colors like '''<kbd>moccasin</kbd>''' or '''<kbd>gainsboro</kbd>''' | ||
* | * RGB hexadecimals, either short form like '''<kbd>#ccc;</kbd>''' or the long form '''<kbd>#ffe228;</kbd>''' (lowercase letters are preferred due to superior gzip compression, always terminated with a semicolon)</td></tr> | ||
<tr><th><code><nowiki>style</nowiki></code></th> | <tr><th><code><nowiki>style</nowiki></code></th> | ||
<td>any other CSS style elements desired beyond or instead of the default formatting, each one terminated with a semicolon</td></tr></table> | <td>any other CSS style elements desired beyond or instead of the default formatting, each one terminated with a semicolon</td></tr></table> | ||
Line 54: | Line 54: | ||
This template uses the following CSS elements as its defaults. Those without an explicit override parameter above can still be changed if necessary by adding them as a value for the <code><nowiki>|style=</nowiki></code> parameter with a space and <kbd>!important</kbd> placed before the terminating semicolon. | This template uses the following CSS elements as its defaults. Those without an explicit override parameter above can still be changed if necessary by adding them as a value for the <code><nowiki>|style=</nowiki></code> parameter with a space and <kbd>!important</kbd> placed before the terminating semicolon. | ||
:<code>style="background: #d3d3d3; color: #000; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%; | :<code>style="background: #d3d3d3; color: #000; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;"</code> | ||
Revision as of 00:00, 19 January 2020
Purpose
This template creates a table cell with a light grey background and black, larger heavy text which defaults to a triple question mark, as seen above. It is designed to generate a uniform appearance for common cell values in feature and comparison tables with minimal effort, alongside similar templates like:
Yes |
or
No |
or
Partial |
Usage
The template will only function properly when used inside of the standard wikicode for tables, following the pipe character(s) which indicate the start of a new table cell. In practice, it looks like this when editing and then when parsed:
{| class="wikitable"
|-
! Template documented?
! Template categorized?
|-
| {{Unknown}}
| {{Yes}}
|}
Template documented? | Template categorized? |
---|---|
??? | Yes |
Custom cell text
The question marks as the cell's content can be replaced with any text desired by assigning it to the value of the |1=
parameter or passing it as the only unnamed parameter. For example, calling this template with either {{Unknown|TBD}} or {{Unknown|1=TBD}} formatting, as both produce the following table cell when transcluded and parsed:
TBD |
Parameters
Changes to the template's appearance when parsed are accomplished by adding parameters to the template call in the form of {{Unknown|name=value}}
. Use as many or as few as needed to accomplish the desired appearance.
Name | Value |
---|---|
1 |
plain text or wiki markup that overrides the default ??? contents (may also be provided as only unnamed parameter) |
align |
left or right align the cell contents to that horizontal edge, overriding the default center alignment |
bgcolor |
changes the background color — values may be:
|
style |
any other CSS style elements desired beyond or instead of the default formatting, each one terminated with a semicolon |
Default style
This template uses the following CSS elements as its defaults. Those without an explicit override parameter above can still be changed if necessary by adding them as a value for the |style=
parameter with a space and !important placed before the terminating semicolon.
style="background: #d3d3d3; color: #000; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;"
An example of such an override (in this instance changing the font-weight parameter which controls the level of typeface boldness to the unbolded value of 500) would look like:
{{Unknown|style=font-weight: 500 !important;}}
which then appears as???
See also
- {{Yes}}
- {{No}}
- {{Partial}}
- {{Beta}}
- Category: Formatting templates