Template:Element cell/navbox and Template:Element cell/navbox/sandbox: Difference between pages

From HandWiki
(Difference between pages)
Page 1
Page 2
imported>Jworkorg
(Created page with "title="{{{title|{{{3|}}}, {{{2|}}}}}}"<!-- --> style="text-align:center;<!-- --> background-color:{{{bg|{{element color|{{{6|white}}}|default=#ffffff}}}}};<!-- --> border...")
 
imported>Jworkorg
(Created page with "{{Documentation subpage}} <!-- Categories and interwikis go at the bottom of this page. --> ==Usage== The template produces format and content for a compact cell (to be used...")
 
Line 1: Line 1:
title="{{{title|{{{3|}}}, {{{2|}}}}}}"<!--
{{Documentation subpage}}
--> style="text-align:center;<!--
<!-- Categories and interwikis go at the bottom of this page. -->
--> background-color:{{{bg|{{element color|{{{6|white}}}|default=&#x23;ffffff}}}}};<!--
--> border:{{#ifeq:{{PAGENAME}}|{{{link|{{{2|}}}}}}|3px solid black|none}};<!--
--> {{{style|}}};"<!--
-->| {{#if:{{{link|{{{2|}}}}}} |[[{{{link|{{{2|}}}}}}{{#if:{{{3|}}}|{{!}}<span style="display:block">{{trim|{{{3|}}}}}}}</span>]]|<span style="display:block">{{trim|{{{3|}}}}}</span>}}<!--


--><noinclude>{{documentation}}</noinclude>
==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:
* {{tl|Periodic table (navbox)}} -- Common PT navbox (32 col)
* {{tl|Extended periodic table (by Fricke, 32 columns, compact)}}
* (and more)
 
{{Element cell/overview}}
{{clear}}
 
==Parameters==
All parameters are optional.
<pre>
{{element cell
| 1= atomic number
| 2= element name
| 3= symbol
| 4= (not used)
| 5= (state of matter, not used)
| 6= metal&ndash;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, 3)
| legend= legend text in title (overrides text part that was composed from 1; 6;)
}}
</pre>
 
===Plain for c/e===
<pre>
{{element cell
| 1=
| 2=
| 3=
| 4=
| 5=
| 6=
| 7=
| link=
| border=
| bg=
| style=
| title=
| legend=
}}
</pre>
Example Hg, in wikitable:
<pre><nowiki>
{|
|-
| {{element cell|80|mercury|Hg||Liquid|Transition metals|Primordial|link=mercury (element)}}
|}</nowiki></pre>
 
{|
|-
| {{element cell|80|mercury|Hg||Liquid|Transition metals|Primordial|link=mercury (element)}}
|}
 
;Top row:
Parameter 1, usually the atomic number, is put in the top row unlinked. If this parameter is present, a &lt;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 {{code|1=&lt;nowiki>}} tags in parameter #1 like this:
<pre>
| {{element cell|&lt;nowiki>*&lt;/nowiki>|Lanthanides}}
</pre>
 
;Page link:
The cell links to parameter 2, usually the element name. If the page name is not the element name, as with {{code|1=<nowiki>[[Mercury (element)]]</nowiki>}}, the correct pagename can be set through {{code|1=link=Mercury (element)}}.
 
;Label:
The link is ''labeled'' with parameter 3 (usually the symbol): {{code|1=<nowiki>link=[[Aluminium|Al]]</nowiki>}}.
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: {{code|1=bg=#aabbcc}}. 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 {{code|border=3px solid red}}. 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: {{code|1=style=width:5em;}}. Do not add quotes ("").
 
;Title:
The title (mousehover text) is created from params 1: 6; 7; 5. (name: category; occurrence; state of matter).<br/>
The emercury example will give: {{code|1=Mercury: transition metals; primordeal; liquid}}<br/>
When parameters {{code|1=bg}} or {{code|1=border}} 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 {{code|1=title=...}}
 
;Legend:
The legend is composed from parameters 6, 5 and 7. It can be overridden by using {{code|1=legend=Special meaning}}. (This can be useful in combination with setting {{code|1=bg=...}}).
 
;Example using parameters
<pre><nowiki>
{|
|-
| {{element cell|one|two|three|bg=yellow|border=3px solid red|link=Main page|title=Some example}}
|}</nowiki></pre>
 
{|
|-
| {{element cell|one|two|three|bg=yellow|border=3px solid red|link=Main page|title=Some example}}
|}
 
==Deprecated==
Deprecated parameters: unnamed parameter number 8, unnamed parameter number 9.
 
==See also==
{{tl|Element cell/overview}}
{{periodic table templates}}
<includeonly>{{Sandbox other||
[[Category:Periodic table style and format templates|Cell, {{PAGENAME}}]]
}}</includeonly>