Template:Unknown/doc: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Simplify syntax of the bgcolor parameter)
(Move template to Category:Table cell templates)
 
Line 1: Line 1:
__NOTOC__
__NOTOC__
== 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 these (each a link to its own template page):
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:
<div style="margin: 1.5em auto; width: fit-content;">
 
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
<table class="wikitable" style="display: inline-table; vertical-align: middle; margin-left: 3em;">
| class="table-yes" style="background-color: #90ff90; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:Yes|Yes]]
  <tr><td class="table-yes" style="background: #90ff90; color: #000; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;">&#8239;[[Template:Yes|Yes]]&#8239;</td></tr>
|}
</table> or
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
<table class="wikitable" style="display: inline-table; vertical-align: middle; margin-left: 1em;">
  | class="table-no" style="background-color: #ff9090; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:No|No]]
  <tr><td class="table-no" style="background: #ff9090; color: #000; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;">&#8239;[[Template:No|No]]&#8239;</td></tr>
|}
</table> or
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
<table class="wikitable" style="display: inline-table; vertical-align: middle; margin-left: 1em;">
| class="table-partial" style="background-color: #ff0; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:Partial|Partial]]
  <tr><td class="table-partial" style="background: #ffff00; color: #000; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;">&#8239;[[Template:Partial|Partial]]&#8239;</td></tr>
|}
</table>
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
| {{Beta}}
|}
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
  | class="table-wip" style="background-color: #c9e0ff; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:Wip|W.I.P.]]
|}
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
| class="table-na" style="background-color: #ffc890; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:NA|N/A]]
|}
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
| class="table-disabled" style="background-color: #ff9090; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:Disabled|Disabled]]
|}
{| class="wikitable" style="display: inline-table; margin: 1em; vertical-align: middle;"
  | class="table-enabled" style="background-color: #90ff90; color: #000; font-size: 1.08em; font-weight: 700; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;" | [[Template:Enabled|Enabled]]
|}
</div>


== Usage ==
== 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:
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:
<poem style="display: inline-block; margin: 0.5em 2.5em 0.5em 6em; width: 30%; padding:15px 15px 15px 15px; background: cornsilk; border: 1px solid #000;">
<div style="margin: 1.5em 0 1.5em 6em; vertical-align: middle;">
<poem style="background-color: cornsilk; border: 2px solid #c7c8c9; color: #000; display: inline-block; font: 500 0.92rem/1.4 monospace; margin: 0 2.5em 0 0; min-width: 25vmax; padding: 0.5em 1em; vertical-align: middle;">
  {| class="wikitable"
  {| class="wikitable"
   |-
   ! scope="col" | Template documented?
  ! Template documented?
   ! scope="col" | Template categorized?
   ! Template categorized?
   |-
   |-
   | '''<nowiki>{{Unknown}}</nowiki>'''
   | '''<nowiki>{{Unknown}}</nowiki>'''
   | <nowiki>{{Yes}}</nowiki>
   | <nowiki>{{Yes}}</nowiki>
   |}
   |}
</poem><table class="wikitable" style="display: inline-block; margin: 0 0 3em 2.5em;">
</poem> <span style="font-size: 1.5rem; font-weight: 900; margin: 0 1em;"></span>
<tr><th>Template documented?</th><th>Template categorized?</th></tr>
{| class="wikitable" style="display: inline-table; margin: 0 0 0 2.5em;"
  <tr><td style="background: #d3d3d3; color: black; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;" class="table-unknown">&#8239;???&#8239;</td><td style="background: #90ff90; color: black; vertical-align: middle; text-align: center; font-weight: 800; font-size: 108%;" class="table-yes">&#8239;Yes&#8239;</td></tr>
! scope="col" | Template documented?
</table>
! scope="col" | Template categorized?
 
|-
=== Custom cell text ===
| {{Unknown}}
The question marks as the cell's content can be replaced with any text desired by assigning it to the value of the <code><nowiki>|1=</nowiki></code> parameter or passing it as the only unnamed parameter. For example, calling this template with either '''<kbd><nowiki>{{Unknown|TBD}}</nowiki></kbd>''' or '''<kbd><nowiki>{{Unknown|1=TBD}}</nowiki></kbd>''' formatting, as both produce the following table cell when transcluded and parsed:
| {{Yes}}
|}
</div>


<table class="wikitable" style="margin-left: 3em;"><tr><td style="background: {{{bgcolor|#d3d3d3;}}} color: black; vertical-align: middle; text-align: {{{align|center}}}; font-weight: 800; font-size: 108%;{{{style|}}}" class="table-unknown">&#8239;TBD&#8239;</td></tr></table>
=== Custom text ===
The triple question marks that are the cell's default contents can be replaced with any text desired, simply by assigning it as the value of the {{Para|1}} parameter or passing it as the only unnamed parameter. For example, calling this template as either '''{{Tlx|Unknown|T.B.D.}}''' or '''{{Tlx|Unknown|2=1=T.B.D.}}''' both produce the following table cell:
{| class="wikitable" style="margin-left: 3em;"
| {{Unknown|T.B.D.}}
|}


=== Parameters ===
=== Parameters ===
Changes to the template's appearance when parsed are accomplished by adding parameters to the template call in the form of '''<code><nowiki>{{Unknown|name=value}}</nowiki></code>'''. Use as many or as few as needed to accomplish the desired appearance.
Changes to the template's appearance when parsed are accomplished by adding parameters to the template call in the form of '''{{Tlx|Unknown|2=<var>name</var>=<var>value</var>}}'''. Use as many or as few as needed to accomplish the desired appearance.
 
{| class="wikitable" style="margin-left: 3em;"
<table class="wikitable"><caption>All available named parameters</caption>
|+ All available template parameters
  <tr><th>Name</th><th>Value</th>
  ! scope="col" | Name
  <tr><th><code><nowiki>1</nowiki></code></th>
! scope="col" | Value
  <td>plain text or wiki markup that overrides the default <span style="color: #000; font-weight: 800; font-size: 108%;">&#8239;???&#8239;</span> contents (may also be provided as only unnamed parameter)</td></tr>
  |-
  <tr><th><code><nowiki>align</nowiki></code></th>
! scope="row" | {{Para|1}}
  <td>'''<kbd>left</kbd>''' or '''<kbd>right</kbd>''' align the cell contents to that horizontal edge, overriding the default center alignment</td></tr>
| Replaces the default <span style="font-size: 1.08em; font-weight: 800;">???</span> cell contents, can include wiki markup syntax (may also be provided as the only unnamed parameter)
  <tr><th><code><nowiki>bgcolor</nowiki></code></th>
  |-
  <td>changes the background color — values may be:
! scope="row" | {{Para|align}}
* keywords like '''<kbd>transparent</kbd>''' or '''<kbd>none</kbd>''' (inheriting the surrounding background color or becoming white, respectively)
| Aligns the cell contents to either of the horizontal margins, rather than the default center alignment; valid values are '''<kbd>left</kbd>''' or '''<kbd>right</kbd>'''
* 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>
! scope="row" | {{Para|bgcolor}}
  <tr><th><code><nowiki>style</nowiki></code></th>
| Specify a different background color — values may be:
  <td>any other CSS style elements desired beyond or instead of the default formatting, each one terminated with a semicolon</td></tr></table>
* CSS3 keywords like '''<kbd>transparent</kbd>''' or '''<kbd>none</kbd>''' (inheriting the surrounding background color or becoming white, respectively)
* Named CSS3 colors like '''<kbd>moccasin</kbd>''' or '''<kbd>gainsboro</kbd>'''
* RGB or RGBA hexadecimal values, in either the short ('''<kbd>#ccc;</kbd>''') or long ('''<kbd>#ffe228;</kbd>''') forms, always terminated with a semicolon (lowercase letters are preferred due to superior gzip compression)
  |-
! scope="row" | {{Para|style}}
| Any other CSS3 inline style elements desired, in addition to or instead of, the default formatting (each one terminated with a semicolon)
|}


=== Default style ===
=== 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 <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 {{Para|style}} parameter and affixing them 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>
::<syntaxhighlight lang="html" inline><td style="background-color: #d3d3d3; color: black; font-size: 1.08em; font-weight: 800; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;"></syntaxhighlight><br />


 
An example of such an override (in this instance changing the font-weight parameter, which controls the level of typeface boldness, to the light semi-bolded value of 500) would look like:
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:
<div style="margin-left: 3em;">'''{{Tlx|Unknown|2=style=font-weight: 500 !important;}}'''&nbsp;&nbsp;which then appears as&nbsp;&nbsp;
 
{| class="wikitable" style="display: inline-table; vertical-align: middle;"
:'''<code><nowiki>{{Unknown|style=font-weight: 500 !important;}}</nowiki></code>'''&nbsp;&nbsp;which then appears as&nbsp;&nbsp;&nbsp;&nbsp;<table class="wikitable" style="display: inline-table; vertical-align: middle;"><tr><td class="table-unknown" style="background: #d3d3d3; color: #000; vertical-align: middle; text-align: center; font-weight: 500; font-size: 108%;">&#8239;???&#8239;</td></tr></table>
| {{Unknown|style=font-weight: 500 !important;}}
|}
</div>


== See also ==
== See also ==
* {{Tl|Yes}}
* {{Tl|Yes}}
* {{Tl|No}}
* {{Tl|No}}
* {{Tl|NA}}
* {{Tl|Enabled}}
* {{Tl|Disabled}}
* {{Tl|Partial}}
* {{Tl|Partial}}
* {{Tl|Wip}}
* {{Tl|Beta}}
* {{Tl|Beta}}
* [[:Category:Formatting templates|Category: Formatting templates]]<includeonly>
* [[:Category:Formatting templates]]
[[Category: Formatting templates]]</includeonly>
* [[:Category:Table cell templates]]<includeonly>
<!-- Categories go here. -->
 
[[Category:Table cell templates]]</includeonly>

Latest revision as of 02:08, 13 September 2022

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 these (each a link to its own template page):

Yes
No
Partial
Beta
W.I.P.
N/A
Disabled
Enabled

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"
  ! scope="col" | Template documented?
  ! scope="col" | Template categorized?
  |-
  | {{Unknown}}
  | {{Yes}}
  |}

Template documented? Template categorized?
 ???  Yes

Custom text

The triple question marks that are the cell's default contents can be replaced with any text desired, simply by assigning it as the value of the |1= parameter or passing it as the only unnamed parameter. For example, calling this template as either {{Unknown|T.B.D.}} or {{Unknown|1=T.B.D.}} both produce the following table cell:

T.B.D.

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.

All available template parameters
Name Value
|1= Replaces the default ??? cell contents, can include wiki markup syntax (may also be provided as the only unnamed parameter)
|align= Aligns the cell contents to either of the horizontal margins, rather than the default center alignment; valid values are left or right
|bgcolor= Specify a different background color — values may be:
  • CSS3 keywords like transparent or none (inheriting the surrounding background color or becoming white, respectively)
  • Named CSS3 colors like moccasin or gainsboro
  • RGB or RGBA hexadecimal values, in either the short (#ccc;) or long (#ffe228;) forms, always terminated with a semicolon (lowercase letters are preferred due to superior gzip compression)
|style= Any other CSS3 inline style elements desired, in addition to 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 and affixing them with a space and !important placed before the terminating semicolon.

<td style="background-color: #d3d3d3; color: black; font-size: 1.08em; font-weight: 800; padding: 0.2em 0.67em; text-align: center; vertical-align: middle;">

An example of such an override (in this instance changing the font-weight parameter, which controls the level of typeface boldness, to the light semi-bolded value of 500) would look like:

{{Unknown|style=font-weight: 500 !important;}}  which then appears as  
 ??? 

See also