Template:Cell: Difference between revisions

From Wikishire
Jump to navigation Jump to search
RB (talk | contribs)
No edit summary
RB (talk | contribs)
No edit summary
Line 1: Line 1:
style="background-color: {{#if:{{{1|}}}|{{{1}}}|<nowiki>#</nowiki>FFFFFF}};"|{{#if:{{{2|}}}|{{{2}}}|8&32;}}<noinclude>
style="background-color: {{#if:{{{1|}}}|{{{1}}}|<nowiki>#</nowiki>FFFFFF}};"|{{#if:{{{2|}}}|{{{2}}}|#&32;}}<noinclude>
{{documentation}}
{{documentation}}
</noinclude>
</noinclude>

Revision as of 21:30, 9 March 2024

style="background-color: #FFFFFF;"|

  1. &32;
[edit] [{{#invoke:Purge|main}}] Template documentation

The {{cell}} template can be used to create a table cell with a specified background colour.

Usage

style="background-color: #FFFFFF;"|
  1. &32;

The template takes one unnamed parameter as input, which is the background colour of the table cell. The default content of each cell is a single non-breaking space with a font-size of 50%. To override the content of each cell, use a second unnamed parameter. To override the default font-size, use the style= parameter.

Complete specification
{{cell|Colour|Text|style=Style}}
Default
{{cell|Colour|&nbsp;|style=font-size:50%;}}

Examples

Example 1

Code
{| width="50%" cellspacing=0
{{cell|red}}{{cell|blue}}{{cell|green}}
|}
Result
style="background-color: red;"|
  1. &32;style="background-color: blue;"|
  2. &32;style="background-color: green;"|
  3. &32;

Example 2

Code
{| width="50%" cellspacing=0
{{cell|red| }}{{cell|blue| }}{{cell|green| }}
|}
Result
style="background-color: red;"|
  1. &32;style="background-color: blue;"|
  2. &32;style="background-color: green;"|
  3. &32;

Example 3

Code
{| width="50%" cellspacing=0
{{cell|red|R|style=text-align:center}}{{cell|blue|B|style=text-align:center}}{{cell|green|G|style=text-align:center}}
|}
Result
style="background-color: red;"|Rstyle="background-color: blue;"|Bstyle="background-color: green;"|G

Note

The {{cell2}} and {{cell3}} templates can be used to condense a sequence of cells of the same colour.

See also