Template:Element cell-compact
title="{{{2}}} " style="text-align:center; background:#ffffff; border:none; ;"|
Usage
The template produces format and content for a compact cell (to be used in a periodic table, navbox style). It is part of a series. Used in:
- {{Periodic table (32 columns, compact)}} -- Common navbox
- {{Extended periodic table (by Fricke, 32 columns, compact)}}
- (and more)
Template:Element cell/overview
Parameters
All parameters are optional.
{{element cell | 1= atomic number | 2= element name | 3= symbol | 4= (not used) | 5= (state of matter, not used) | 6= metal–nonmetal category name (sets background color) | 7= occurrence (not used) | link= wikipedia page (overrides 2; creates a wikilink like [[Mercury (element)|mercury]]) | bg= background color (overrides 6; can look like bg=#aabbcc) | border= (not used) | style= adds or overrides style settings (do not add the "" quotes) | title= (mousehoover text, overrides title composed from 2: 1; 6) | legend= legend text in title (overrides text part that was composed from 1; 6;) }}
Plain for c/e
{{element cell | 1= | 2= | 3= | 4= | 5= | 6= | 7= | link= | border= | bg= | style= | title= | legend= }}
Example Hg, in wikitable:
{| |- | {{element cell|80|mercury|Hg||Liquid|Transition metals|Primordial|link=mercury (element)}} |}
80 Hg |
- Top row
Parameter 1, usually the atomic number, is put in the top row unlinked. If this parameter is present, a <br/> is added. The font color is set by parameter 5, usually the state of matter key.
- Asterisk (*)
To add a plain asterisk, as is done to mark lanthanides and actinides, add them in <syntaxhighlight lang="text" enclose="none"><nowiki></syntaxhighlight>
tags in parameter #1 like this:
| {{element cell|<nowiki>*</nowiki>|Lanthanides}}
- Page link
The cell links to parameter 2, usually the element name. If the page name is not the element name, as with <syntaxhighlight lang="text" enclose="none">[[Mercury (element)]]</syntaxhighlight>
, the correct pagename can be set through <syntaxhighlight lang="text" enclose="none">link=Mercury (element)</syntaxhighlight>
.
- Label
The link is labeled with parameter 3 (usually the symbol): <syntaxhighlight lang="text" enclose="none">link=[[Aluminium|Al]]</syntaxhighlight>
.
If there is no link provided (no parameter 2, no link=), parameter 3 will show as unlinked text.
- Background
The background color is set by parameter 6, usually the category name. It can be set by parameter bg: <syntaxhighlight lang="text" enclose="none">bg=#aabbcc</syntaxhighlight>
. Parameter bg is used for just a color, with no legend meaning (no text in the title).
- Frame (cell border)
The frame style is set via parameter 7, usually the occurrence. It can be overridden by using <syntaxhighlight lang="text" enclose="none">{{{1}}}</syntaxhighlight>
. This sets the border (frame), but does not have a legend meaning (no text in the title).
- Style
All style can be set (and overridden) by using the style parameter: <syntaxhighlight lang="text" enclose="none">style=width:5em;</syntaxhighlight>
. Do not add quotes ("").
- Title
The title (mousehover text) is created from params 1: 6; 7; 5. (name: category; occurrence; state of matter).
The emercury example will give: <syntaxhighlight lang="text" enclose="none">Mercury: transition metals; primordeal; liquid</syntaxhighlight>
When parameters <syntaxhighlight lang="text" enclose="none">bg</syntaxhighlight>
or <syntaxhighlight lang="text" enclose="none">border</syntaxhighlight>
are used, their setting is not added to the title (they are meaningless).
The title can be set (overridden) to any text, including a blank, by using <syntaxhighlight lang="text" enclose="none">title=...</syntaxhighlight>
- Legend
The legend is composed from parameters 6, 5 and 7. It can be overridden by using <syntaxhighlight lang="text" enclose="none">legend=Special meaning</syntaxhighlight>
. (This can be useful in combination with setting <syntaxhighlight lang="text" enclose="none">bg=...</syntaxhighlight>
).
- Example using parameters
{| |- | {{element cell|one|two|three|bg=yellow|border=3px solid red|link=Main page|title=Some example}} |}
one three |
Deprecated
Deprecated parameters: unnamed parameter number 8, unnamed parameter number 9.
See also
Template:Element cell/overview
The above documentation is transcluded from Template:Element cell-compact/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |