Template:Navbox with columns/doc: Difference between revisions

From MC Public Wiki
Jump to navigation Jump to search
(Created page with "{{documentation subpage}} <includeonly>{{high-risk| 1,500,000+ }}</includeonly> {{Navbox suite}} This template allows a navigational template t...")
 
No edit summary
 
Line 1: Line 1:
{{documentation subpage}}
{{Documentation subpage}}
<includeonly>{{high-risk| 1,500,000+ }}</includeonly>
{{Navbox suite}}
{{Navbox suite}}
This template allows a [[Wikipedia:Navigation templates|navigational template]] to be set up relatively quickly by supplying it with one or more lists of links. It comes equipped with default styles that should work for most navigational templates. Changing the default styles is possible, but not recommended.  Using this template, or one of its "Navbox suite" sister templates, is highly recommended for standardization of navigational templates, and for ease of use.
A navigation box that presents its content in columns. Originally intended to provide a relatively straightforward means to align links prefixed by flag icons, e.g. in templates offering links to country articles.


== Usage ==
== Basic syntax ==
Please remove the parameters that are left blank.
Only required parameters and ''colwidth'' included.


<pre style="overflow:auto;">{{Navbox
<pre style="overflow:auto;">
{{Navbox with columns
|name      = {{subst:PAGENAME}}
|name      = {{subst:PAGENAME}}
|title      =  
|title      =  
|image      =  
|titleclass =  
|above      =  
|bodyclass  =  
|state      =  
|colwidth = <!--(to set a default width for each column,
|listclass = hlist
                  preferably in a proportional unit such as 'em'*)-->
|col1 =  
|col2  =
}}
</pre>
<div style="line-height:1.35em; font-size:90%;">* See [[Em (typography)]]. Using proportional units means the template should still be displayed correctly across a range of browser font-sizes. If ''colwidth'' not specified, a default 10em is used.</div>


|group1    =  
== Parameters ==
|list1      =
=== Setup parameters ===
:;''name''<ref name="common">Parameters marked with a footnote '''<sup>[1]</sup>''' are parameters in common with the sister templates {{tl|Navbox}} and {{tl|Navbox with collapsible groups}}. A much more complete description of those parameters is available at {{tl|Navbox}}.</ref>
::The name of the template. The name of this template, for example, is "Navbox with columns".


|group2    =  
:;''state''<ref name="common"/>
|list2      =
::Possible values are <code>collapsed</code>, <code>uncollapsed</code>, <code>plain</code>, <code>off</code>, and the default <code>autocollapse</code>.  See {{tl|Navbox}} for more information.
...
|group20    =
|list20    =


|below      =  
:;''navbar''<ref name="common"/>
}}
::Possible values are <code>plain</code>, <code>off</code>, and the default value of blank.  See {{tl|Navbox}} for more information.
</pre>
 
:;''border''<ref name="common"/>
::Possible values are <code>child</code>, <code>none</code>, and the default value of blank.  Set to <code>child</code> if you wish to use the navbox inside of another navbox; with this option, the child navbox is borderless and fits snuggly inside of its parent navbox.  The parent navbox may be the list area of {{tl|Navbox}}, a columns of another {{tl|Navbox with columns}}, or a section of {{tl|Navbox with collapsible groups}}.  See {{tl|Navbox}} for more information and examples.


== Parameter list ==
===Basic data parameters===
{{Navbox
:;'''''title'''''<ref name="common"/>
|name = Navbox/doc
::The title of the template, displayed centered in the titlebar at the top of the template.
|state = uncollapsed
|image = {{{image}}}
|title = {{{title}}}
|above = {{{above}}}
|group1 = {{{group1}}}
|list1 = {{{list1}}}
|group2 = {{{group2}}}
|list2 = {{{list2}}}
|list3 = {{{list3}}} ''without {{{group3}}}''
|group4 = {{{group4}}}
|list4 = {{{list4}}}
|below = {{{below}}}<br/>See alternate navbox formats under: [[#Layout of table|''Layout of table'']]
}}
The navbox uses lowercase parameter names, as shown in the box (''at right'').  The mandatory ''name'' and ''title'' will create a one-line box if other parameters are omitted.
<br/>


Notice "group1" (etc.) is optional, as are sections named "above/below".
:;''above''<ref name="common"/>
{{-}}
::Text or other elements to appear above the columns.
The basic and most common parameters are as follows (see [[#Parameter descriptions|below]] for the full list):


:<code>name - </code>the name of the template.
:;''image''<ref name="common"/>
:<code>title - </code>text in the title bar, such as: <nowiki>[[Widget stuff]]</nowiki>.
::Image to the right of all of the columns.
:<code>state - </code>controls when a navbox is expanded or collapsed.


:<code>listclass - </code>a CSS class for the list cells, usually <tt>hlist</tt> for horizontal lists.
:;''imageleft''<ref name="common"/>
:<code>titlestyle - </code>a CSS style for the title-bar, such as: <code>background:gray;</code>
::Image to the left of all of the columns.
:<code>groupstyle - </code>a CSS style for the group-cells, such as: <code>background:#eee;</code>


:<code>image - </code>an optional right-side image, coded as the whole image. Typically it is [[WP:ALT#Purely decorative images|purely decorative]], so it should be coded as <code><nowiki>[[File:</nowiki><var>XX</var><nowiki>.jpg|80px|link=|alt=]]</nowiki></code>.
:;''below''<ref name="common"/>
:<code>imageleft - </code>an optional left-side image (code the same as the "image" parameter).
::Text or other elements to appear below the columns.


:<code>above - </code>text to appear above the group/list section (could be a list of overall wikilinks).
===Style parameters===
:;''style''<ref name="common"/>
::CSS style/s to apply to the template's body (i.e. including space not used by columns)


:<code>group<sub>n</sub> - </code>the left-side text before list-n (if group-n omitted, list-n starts at left of box).
:;''titlestyle''<ref name="common"/>
:<code>list<sub>n</sub> - </code>text listing wikilinks, often separated by middot templates, such as: [<font/>[A]]<code>{<font/>{·}}</code> [<font/>[B]]
::[[Wikipedia:CSS|CSS]] style/s to apply to titlebar; usually <code>background:''color''</code> (background defaults to [[Wikipedia:NavFrame|NavHead]] default).
:<code>below - </code>optional text to appear below the group/list section.


== Parameter descriptions ==
:;''abovestyle''<ref name="common"/>
The following is a complete list of parameters for using {{tl|Navbox}}.  In most cases, the only required parameters are <code>name</code>, <code>title</code>, and <code>list1</code>, though [[Template:Navbox/doc#Child navboxes|child navboxes]] do not even require those to be set.
:;''belowstyle''<ref name="common"/>
::CSS style/s to apply to the ''above'' and ''below'' parameters, respectively.


{{tl|Navbox}} shares numerous common parameter names with its sister templates, {{tl|Navbox with columns}} and {{tl|Navbox with collapsible groups}}, for consistency and ease of use.  Parameters marked with an asterisk <nowiki>(*)</nowiki> are common to all three master templates.
:;''basestyle''<ref name="common"/>
::CSS style/s to apply to the ''title'', ''above'', and ''below'', parameters, all at the same time.


=== Setup parameters ===
:;''imagestyle''<ref name="common"/>
:; ''name''<nowiki>*</nowiki>
::CSS style/s to apply to the ''image'' parameter.
:: The name of the template, which is needed for the "v{{·}} d{{·}} e" ("view{{·}} discuss{{·}} edit") links to work properly on all pages where the template is used. You can enter <code><nowiki>{{subst:PAGENAME}}</nowiki></code> for this value as a shortcut.  The name parameter is only mandatory if a <code>title</code> is specified, and the <code>border</code> parameter is not set.


:; ''state''<nowiki>*</nowiki> <span style="font-weight:normal;">[<code>autocollapse, uncollapsed, collapsed, plain, off</code>]</span>
:;''imageleftstyle''<ref name="common"/>
:* Defaults to <code>autocollapse</code>. A navbox with <code>autocollapse</code> will start out collapsed if there are two or more tables on the same page that use other collapsible tables. Otherwise, the navbox will be expanded. For the technically minded, see [[MediaWiki:Common.js]].
::CSS style/s to apply to the ''imageleft'' parameter
:* If set to <code>collapsed</code>, the navbox will always start out in a collapsed state.
:* If set to <code>plain</code>, the navbox will always be expanded with no [hide] link on the right, and the title will remain centered (by using padding to offset the <small>v • d • e</small> links).
:* If set to <code>off</code>, the navbox will always be expanded with no [hide] link on the right, but no padding will be used to keep the title centered.  This is for advanced use only; the "plain" option should suffice for most applications where the [show]/[hide] button needs to be hidden.
:*If set to anything other than <code>autocollapse</code>, <code>collapsed</code>, <code>plain</code>, or <code>off</code> (such as "uncollapsed"), the navbox will always start out in an expanded state, but have the "hide" button.


: To show the box when standalone (non-included) but then auto-hide contents when in an article, put "uncollapsed" inside &lt;noinclude> tags:
:;''colstyle''
:* <code>state = </code><nowiki><noinclude>uncollapsed</noinclude></nowiki>
::CSS style/s to apply across all columns; if used, usually <code>background:''color''</code> per ''titlestyle'' above.
:* That setting will force the box visible when standalone (even when followed by other boxes), displaying "[hide]" but then auto-collapse the box when stacked inside an article.


: Often times, editors will want a default initial state for a navbox, which may be overridden in an article. Here is the trick to do this:
:;''oddcolstyle''
:*In your intermediate template, create a parameter also named "state" as a pass-through like this:
:;''evencolstyle''
:*<tt><nowiki>| state = {{{state<includeonly>|your_desired_initial_state</includeonly>}}}</nowiki></tt>
::CSS style/s to apply to all odd/even-numbered columns, respectively.
:*The <nowiki><includeonly>|</nowiki> will make the template expanded when viewing the template page by itself.


::*Example: {{tl|peso}} with autocollapse as the default initial state. [[Catalan peseta]] transcludes it and has only one navbox. So the peso navbox shows. [[Chilean peso]] has two navboxes. So the peso navbox collapses.
:;''col<sub>n</sub>style''
::*Example: {{tl|Historical currencies of Hungary}} with expanded as the default initial state. All transcluding articles shows the content by default, unless there were an hypothetical article that specifies state = collapsed when transcluding.
::CSS style/s to apply to the n<sup>th</sup> column only.


:; ''navbar''<nowiki>*</nowiki>
:;''colheaderstyle''
:: If set to <code>plain</code>, the <span style="font-size:88%;">v • d • e</span> links on the left side of the titlebar will not be displayed, and padding will be automatically used to keep the title centered.  Use <code>off</code> to remove the <span style="font-size:88%;">v • d • e</span> links, but not apply padding (this is for advanced use only; the "plain" option should suffice for most applications where a navbar is not desired). It is highly recommended that one not hide the navbar, in order to make it easier for users to edit the template, and to keep a standard style across pages.
::CSS style/s to apply to all column headers.


:; ''border''<nowiki>*</nowiki>
:;''col<sub>n</sub>headerstyle''
:: ''See section below on using navboxes within one another for examples and a more complete description.''  If set to <code>child</code> or <code>subgroup</code>, then the navbox can be used as a borderless child that fits snuggly in another navbox.  The border is hidden and there is no padding on the sides of the table, so it fits into the ''list'' area of its parent navbox.  If set to <code>none</code>, then the border is hidden and padding is removed, and the navbox may be used as a child of another container (do not use the <code>none</code> option inside of another navbox; similarly, only use the <code>child</code>/<code>subgroup</code> option inside of another navbox).  If set to anything else (default), then a regular navbox is displayed with a 1px border.  An alternate way to specify the border to be a subgroup style is like this (i.e. use the first unnamed parameter instead of the named ''border'' parameter):
::CSS style/s to apply to the n<sup>th</sup> column header.
:::<code><nowiki>{{Navbox|child</nowiki></code>
::::<code>...
:::<code><nowiki>}}</nowiki></code>


=== Cells ===
:;''col<sub>n</sub>footerstyle''
:; ''title''<nowiki>*</nowiki>
::CSS style/s to apply to the n<sup>th</sup> column footer cell.
:: Text that appears centered in the top row of the table. It is usually the template's topic, i.e. a succinct description of the body contents. This should be a single line, but if a second line is needed, use <code><nowiki>{{-}}</nowiki></code> to ensure proper centering.  This parameter is technically not mandatory, but using {{tl|Navbox}} is rather pointless without a title.


:; ''group<sub>n</sub>''<nowiki>*</nowiki>
===Columns parameters===
:: (i.e. ''group1'', ''group2'', etc.) If specified, text appears in a header cell displayed to the left of ''list<sub>n</sub>''. If omitted, ''list<sub>n</sub>'' uses the full width of the table.
:;''colwidth''
::Width, preferably in a proportional unit such as '[[Em (typography)|em]]', or as a percentage, used for each column whose width not specified by ''colNwidth'' below. Defaults to 10em.  Examples:
:::<code>colwidth = 15em</code>
:::<code>colwidth = 25%</code>


:; ''list<sub>n</sub>''<nowiki>*</nowiki>
:;''fullwidth''
:: (i.e. ''list1'', ''list2'', etc.) The body of the template, usually a list of links. Format is inline, although the text can be entered on separate lines if the entire list is enclosed within <code><nowiki><div> </div></nowiki></code>At least one ''list'' parameter is required; each additional ''list'' is displayed in a separate row of the tableEach ''list<sub>n</sub>'' may be preceded by a corresponding ''group<sub>n</sub>'' parameter, if provided (see below).
::If set to anything, then the total width of the columns are scaled linearly to make the sum of the widths 100%. A rather advanced parameter, this usually need not be used and should be left blankIf a colheader or colfooter is used, then fullwidth is used automaticallyExample:
:::<code>fullwidth = true</code>


:; ''image''<nowiki>*</nowiki>
:;''padding''
:: An image to be displayed in a cell below the title and to the right of the body (the groups/lists). For the image to display properly, the ''list1'' parameter must be specified. The ''image'' parameter accepts standard wikicode for displaying an image, ''e.g.'':
::Padding before first column, preferably in a proportional unit. Defaults to 5em. Padding is disabled by setting it to 0 (or 0em, or 0%).
::: <code><nowiki>[[File:</nowiki><var>XX</var><nowiki>.jpg|80px|link=|alt=]]</nowiki></code>


:; ''imageleft''<nowiki>*</nowiki>
:;''col<sub>n</sub>width''
:: An image to be displayed in a cell below the title and to the left of the body (lists). For the image to display properly, the ''list1'' parameter must be specified and no groups can be specified. It accepts the same sort of parameter that ''image'' accepts.
::The n<sup>th</sup> column's width (overrides ''colwidth'' above).


:; ''above''<nowiki>*</nowiki>
:;'''''col<sub>n</sub>'''''
:: A full-width cell displayed between the titlebar and first group/list, i.e. ''above'' the template's body (groups, lists and image). In a template without an image, ''above'' behaves in the same way as the ''list1'' parameter without the ''group1'' parameter.
::The content of the n<sup>th</sup> column. If any columns are used, then <code>col1</code> is required. There can be a maximum of 20 columns.


:; ''below''<nowiki>*</nowiki>
:;''col<sub>n</sub>header''
:: A full-width cell displayed ''below'' the template's body (groups, lists and image). In a template without an image, ''below'' behaves in the same way as the template's final ''list<sub>n</sub>'' parameter without a ''group<sub>n</sub>'' parameter. For an example of the ''below'' parameter in use, see {{oldid|Main Page|352612160|this}} version of {{tl|Lists of the provinces and territories of Canada}}.
::A header cell for the n<sup>th</sup> column that appears above the column. See below for examples.


=== Style parameters ===
:;''col<sub>n</sub>footer
Styles are generally advised against, to maintain consistency among templates and pages in Wikipedia; but the option to modify styles is given.
::A footer cell that appears below the n<sup>th</sup> column.


:; ''style''<nowiki>*</nowiki>
:;''col<sub>n</sub>headercolspan
:: Specifies [[Cascading Style Sheets|CSS]] styles to apply to the template bodyThe parameter ''bodystyle'' also does the exact same thing and can be used in place of this ''style'' parameterThis option should be used sparingly as it can lead to visual inconsistencies. Examples:
::A number specifying how many columns the n<sup>th</sup> column header should spanIt defaults to 1If it is greater than one, then do not specify column headers that it covers. For example, if <code>col1headercolspan = 3</code>, then leave <code>col2header</code> and <code>col3header</code> blank.
::: <code>style = background:#''nnnnnn'';</code>
::: <code>style = width:''N''&nbsp;[em/%/px or width:auto];</code>
::: <code>style = float:[''left/right/none''];</code>
::: <code>style = clear:[''right/left/both/none''];</code>


:; ''basestyle''<nowiki>*</nowiki>
:;''col<sub>n</sub>footercolspan
:: CSS styles to apply to the ''title'', ''above'', ''below'', and ''group'' cells all at onceThe styles are not applied to ''list'' cellsThis is convenient for easily changing the basic color of the navbox without having to repeat the style specifications for the different parts of the navboxExamples:
::A number specifying how many columns the n<sup>th</sup> column footer should spanIt defaults to 1If it is greater than one, then do not specify column footers that it coversFor example, if <code>col1footercolspan = 3</code>, then leave <code>col2footer</code> and <code>col3footer</code> blank.
::: <code>basestyle = background:lightskyblue;</code>


:; ''titlestyle''<nowiki>*</nowiki>
===Additional groups/lists===
:: [[Cascading Style Sheets|CSS]] styles to apply to ''title'', most often the titlebar's background color:
You may wish to add a few extra groups and/or lists below the columns.  The following parameters are given to provide such functionality.  See {{tl|Navbox}} for a more complete description of how they work, and for more examples.
::: <code><nowiki>titlestyle = background:</nowiki>''#nnnnnn'';</code>
::: <code><nowiki>titlestyle = background:</nowiki>''name'';</code>


:; ''groupstyle''<nowiki>*</nowiki>
:;''group<sub>n</sub>''<ref name="common"/>
:: CSS styles to apply to the ''groupN'' cells. This option overrides any styles that are applied to the entire table. Examples:
::Allows up to 6 additional groups to go along with the lists below the columns.
::: <code>groupstyle = background:#''nnnnnn'';</code>
::: <code>groupstyle = text-align:[''left/center/right''];</code>
::: <code>groupstyle = vertical-align:[''top/middle/bottom''];</code>


:; ''group<sub>n</sub>style''<nowiki>*</nowiki>
:;''list<sub>n</sub>''<ref name="common"/>
:: CSS styles to apply to a specific group, in addition to any styles specified by the ''groupstyle'' parameter.  This parameter should only be used when absolutely necessary in order to maintain standardization and simplicity. Examples:
::Allows up to 6 additional lists below the columns.
::: <code>group3style = background:red;color:white;</code>


:; ''groupwidth''
:;''groupstyle<ref name="common"/>
:: A number and unit specifying a uniform width for the group cells, in cases where little content in the list cells may cause group cells to be too wide. No default. However, may be overridden by the ''group(n)style'' parameter. Examples:
::The general CSS style/s for the groups.
::: <code>groupwidth = 9em</code>


:; ''liststyle''<nowiki>*</nowiki>
:;''group<sub>n</sub>''style<sup></sup>
:: CSS styles to apply to all lists. Overruled by the ''oddstyle'' and ''evenstyle'' parameters (if specified) below. When using backgound colors in the navbox, see the [[#Intricacies|note below]].
::CSS style/s for the n<sup>th</sup> group parameter.<ref name="common"/>
:;''liststyle''<ref name="common"/>
::The general CSS style/s for the lists.


:; ''list<sub>n</sub>style''<nowiki>*</nowiki>
:;''list<sub>n</sub>style''
:: CSS styles to apply to a specific list, in addition to any styles specified by the ''liststyle'' parameter. This parameter should only be used when absolutely necessary in order to maintain standardization and simplicity.  Examples:
::CSS style/s for the n<sup>th</sup> list parameter.
::: <code>list5style = background:#ddddff;</code>


:; ''listpadding''<nowiki>*</nowiki>
:;''listpadding''<ref name="common"/>
:: A number and unit specifying the padding in each ''list'' cell. The ''list'' cells come equipped with a default padding of 0.25em on the left and right, and 0em on the top and bottom.  Due to complex technical reasons, simply setting "liststyle=padding:0.5em;" (or any other padding setting) will not work.  Examples:
::Amount of padding to have in each list cell.
::: <code>listpadding = 0.5em 0em; </code> (sets 0.5em padding for the left/right, and 0em padding for the top/bottom.)
::: <code>listpadding = 0em; </code> (removes all list padding.)


:; ''oddstyle''
:; ''oddstyle''
Line 178: Line 148:


:; ''evenodd'' <span style="font-weight:normal;"><code>[swap, even, odd, off]</code></span>
:; ''evenodd'' <span style="font-weight:normal;"><code>[swap, even, odd, off]</code></span>
:: If set to <code>swap</code>, then the automatic striping of even and odd rows is reversed.  Normally, even rows get a light gray background for striping; when this parameter is used, the odd rows receive the gray striping instead of the even rows.  Setting to <code>even</code> or <code>odd</code> sets all rows to have that striping color.  Setting to <code>off</code> disables automatic row striping.  This advanced parameter should only be used to fix problems when the navbox is being used as a child of another navbox and the stripes do not match up.  Examples and a further description can be found in the section on child navboxes below.
::See {{tl|Navbox}} for description.
 
:; ''abovestyle''<nowiki>*</nowiki>
:; ''belowstyle''<nowiki>*</nowiki>
:: CSS styles to apply to the top cell (specified via the ''above'' parameter) and bottom cell (specified via the ''below'' parameter). Typically used to set background color or text alignment:
::: <code>abovestyle = background:#''nnnnnn'';</code>
::: <code>abovestyle = text-align:[''left/center/right''];</code>
 
:; ''imagestyle''<nowiki>*</nowiki>
:; ''imageleftstyle''<nowiki>*</nowiki>
:: CSS styles to apply to the cells where the image/imageleft sits.  These styles should only be used in exceptional circumstances, usually to fix width problems if the width of groups is set and the width of the image cell grows too large.  Examples:
::: <code>imagestyle = width:5em;</code>
 
===== Default styles =====
The style settings listed here are those that editors using the navbox change most often. The other more complex style settings were left out of this list to keep it simple.  Most styles are set in [[MediaWiki:Common.css]].
 
:<code>bodystyle  = background:#fdfdfd; width:100%; vertical-align:middle;</code>
:<code>titlestyle = background:#ccccff; padding-left:1em; padding-right:1em; text-align:center;</code>
:<code>abovestyle = background:#ddddff; padding-left:1em; padding-right:1em; text-align:center;</code>
:<code>belowstyle = background:#ddddff; padding-left:1em; padding-right:1em; text-align:center;</code>
:<code>groupstyle = background:#ddddff; padding-left:1em; padding-right:1em; text-align:right;</code>
:<code>liststyle  = background:transparent; text-align:left/center;</code>
:<code>oddstyle  = background:transparent;</code>
:<code>evenstyle  = background:#f7f7f7;</code>
 
Since ''liststyle'' and ''oddstyle'' are transparent, odd lists have the color of the ''bodystyle'', which defaults to #fdfdfd (white with a hint of gray). A list defaults to <code>text-align:left;</code> if it has a group, if not it defaults to <code>text-align:center;</code>. Since only ''bodystyle'' has a vertical-align all the others inherit its <code>vertical-align:middle;</code>.
 
=== Advanced parameters ===
:; ''aboveclass''
:; ''groupclass''
:; ''listclass''
:; ''belowclass''
:: This enables attaching a CSS class to group or list cells. The most common use for ''listclass'' is to give it the <tt>hlist</tt> class that will cause lists to render horizontally. All these parameters accept the <code>hlist</code> class, but if more than one parameter is used for <code>hlist</code>, use {{para|bodyclass|hlist}} instead.
 
:; ''titlegroup''
:: This puts a group in the title area, with the same default styles as ''group<sub>n</sub>''. It should be used only in exceptional circumstances (usually advanced meta-templates) and its use requires some knowledge of the internal code of {{tl|Navbox}}; you should be ready to manually set up CSS styles to get everything to work properly if you wish to use it. If you think you have an application for this parameter, it might be best to change your mind, or consult the talk page first.
 
:; ''titlegroupstyle''
:: The styles for the titlegroup cell.
 
:; ''innerstyle''
:: A very advanced parameter to be used ''only'' for advanced meta-templates employing the navbox. Internally, the navbox uses an outer table to draw the border, and then an inner table for everything else (title/above/groups/lists/below/images, etc.). The ''style''/''bodystyle'' parameter sets the style for the outer table, which the inner  table inherits, but in advanced cases (meta-templates) it may be necessary to directly set the style for the inner table. This parameter provides access to that inner table so styles can be applied. Use at your own risk.


====Microformats====
=== Microformats ===
:; ''bodyclass''
;bodyclass : This parameter is inserted into the "class" attribute for the infobox as a whole.
:: This parameter is inserted into the "class" attribute for the infobox as a whole.
;titleclass : This parameter is inserted into the "class" attribute for the infobox's title caption.
 
:; ''titleclass''
:: This parameter is inserted into the "class" attribute for the infobox's title caption.


This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. To flag a navbox as containing [[hCard]] information about a person, for example, add the following parameter:
This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. To flag a navbox as containing [[hCard]] information about a person, for example, add the following parameter:
Line 249: Line 175:


See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
See [[Wikipedia:WikiProject Microformats]] for more information on adding microformat information to Wikipedia, and [[microformat]] for more information on microformats in general.
== Layout of table ==
Table generated by {{tl|Navbox}} '''without''' ''image'', ''above'' and ''below'' parameters (gray list background color added for illustration only):
{{Navbox
|name = Navbox/doc
|state = uncollapsed
|liststyle = background:silver;
|title = {{{title}}}
|group1 = {{{group1}}}
|list1 = {{{list1}}}
|group2 = {{{group2}}}
|list2 = {{{list2}}}
|list3 = {{{list3}}} ''without {{{group3}}}''
|group4 = {{{group4}}}
|list4 = {{{list4}}}
}}
Table generated by {{tl|Navbox}} '''with''' ''image'', ''above'' and ''below'' parameters (gray list background color added for illustration only):
{{Navbox
|name = Navbox/doc
|state = uncollapsed
|liststyle = background:silver;
|image = {{{image}}}
|title = {{{title}}}
|above = {{{above}}}
|group1 = {{{group1}}}
|list1 = {{{list1}}}
|group2 = {{{group2}}}
|list2 = {{{list2}}}
|list3 = {{{list3}}} ''without {{{group3}}}''
|group4 = {{{group4}}}
|list4 = {{{list4}}}
|below = {{{below}}}
}}
Table generated by {{tl|Navbox}} '''with''' ''image'', ''imageleft'', ''lists'', and '''without''' ''groups'', ''above'', ''below'' (gray list background color added for illustration only):
{{Navbox
|name = Navbox/doc
|state = uncollapsed
|liststyle = background:silver;
|image = {{{image}}}
|imageleft = {{{imageleft}}}
|title = {{{title}}}
|list1 = {{{list1}}}
|list2 = {{{list2}}}
|list3 = {{{list3}}}
|list4 = {{{list4}}}
}}


== Examples ==
== Examples ==
<!--Please do not encourage folks to use <div>s within Navboxes as (unless handled carefully) they can negate liststyles/groupstyles/etc settings.-->
===Basic example===
<pre style="overflow:scroll;">
{{Navbox with columns
|name    = East Asia Summit (EAS)
|title  = Member states of the [[East Asia Summit|East Asia Summit (EAS)]]
|width  = 18.25em
|padding = 10em


=== No image ===
|above = ''This is where the <nowiki>{{{above}}}</nowiki> would appear.''
<pre style="overflow:auto;">
{{Navbox
| name  = Navbox/doc
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| listclass = hlist


| group1 = Centre
|col1 = {{AUS}}<br> {{BRU}}<br> {{flag|CHN|name=PR China}}<br> {{CAM}}
| list1  =  
|col2 = {{IND}}<br> {{IDN}}<br> {{JPN}}<br> {{LAO}}
* [[Cyberjaya]]
|col3 = {{MAS}}<br> {{MMR}}<br> {{NZL}}<br> {{PHI}}
|col4width = 17em
|col4 = {{SIN}}<br> {{KOR}}<br> {{THA}}<br> {{VIE}}


| group2 = Area
|below = '''Potential future members'''{{spaces|6}}{{TLS}}{{spaces|3}}{{RUS}}
| list2  =
* [[Klang Valley]]
 
| group3 = Major landmarks
| list3  =
* [[Petronas Twin Towers]]
* [[Kuala Lumpur Tower]]
* [[Kuala Lumpur Sentral]]
* [[Technology Park Malaysia]]
* [[Putrajaya]]
* [[Cyberjaya]]
* [[Kuala Lumpur International Airport]]
 
| group4 = Infrastructure
| list4  =
* [[Express Rail Link]]
* [[KL-KLIA Dedicated Expressway]]
 
| group5 = Prime applications
| list5  =
* [[EGovernment]]
* [[MyKad]]
}}
}}
</pre>
</pre>
{{Navbox with columns
|name    = East Asia Summit (EAS)
|state  = uncollapsed
|title  = Member states of the [[East Asia Summit|East Asia Summit (EAS)]]
|width  = 18.25em
|padding = 10em


{{Navbox
|above = ''This is where the <nowiki>{{{above}}}</nowiki> parameter would appear.''
| name  = Navbox/doc
| state  = uncollapsed
| title  = [[Multimedia Super Corridor|MSC Malaysia]]
| listclass = hlist


| group1 = Centre
|col1 = {{AUS}}<br> {{BRU}}<br> {{flag|CHN|name=PR China}}<br> {{CAM}}
| list1  =  
|col2 = {{IND}}<br> {{IDN}}<br> {{JPN}}<br> {{LAO}}
* [[Cyberjaya]]
|col3 = {{MAS}}<br> {{MMR}}<br> {{NZL}}<br> {{PHI}}
|col4width = 17em
|col4 = {{SIN}}<br> {{KOR}}<br> {{THA}}<br> {{VIE}}


| group2 = Area
|below = '''Potential future members'''{{spaces|6}}{{TLS}}{{spaces|3}}{{RUS}}
| list2  =
* [[Klang Valley]]
 
| group3 = Major landmarks
| list3  =
* [[Petronas Twin Towers]]
* [[Kuala Lumpur Tower]]
* [[Kuala Lumpur Sentral]]
* [[Technology Park Malaysia]]
* [[Putrajaya]]
* [[Cyberjaya]]
* [[Kuala Lumpur International Airport]]
 
| group4 = Infrastructure
| list4  =
* [[Express Rail Link]]
* [[KL-KLIA Dedicated Expressway]]
 
| group5 = Prime applications
| list5  =
* [[EGovernment]]
* [[MyKad]]
}}
}}


=== With image, without groups ===
===Example with percentage widths===
<pre style="overflow:auto;">
<pre style="overflow:scroll;">
{{Navbox
{{Navbox with columns
| name = Navbox/doc
| name = Plastics
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| title = [[Plastic]]s
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| colwidth = 33%
| listclass = hlist
| colstyle = text-align: center
 
| col1 = [[Polyethylene]] (PE)<br> [[Polyethylene terephthalate]] (PET or PETE)<br> [[Polyvinyl chloride]] (PVC)<br> [[Polyvinylidene chloride]] (PVDC)<br> [[Polylactic acid]] (PLA)
| list1 =
| col2 = [[Polypropylene]] (PP)<br> [[Polyamide]] (PA)<br> [[Polycarbonate]] (PC)<br> [[Polytetrafluoroethylene]] (PTFE)<br> [[Polyurethane]] (PU)
* [[Petronas Twin Towers]]
| col3 = [[Polystyrene]] (PS)<br> [[Polyester]]<br> [[Acrylonitrile butadiene styrene]] (ABS)<br> [[Acrylic glass|Polymethyl methacrylate]] (PMMA)<br> [[Polyoxymethylene]] (POM)
* [[Kuala Lumpur Tower]]
* [[Kuala Lumpur Sentral]]
* [[Technology Park Malaysia]]
* [[Putrajaya]]
* [[Cyberjaya]]
* [[Kuala Lumpur International Airport]]
}}
}}
</pre>
</pre>
{{Navbox
{{Navbox with columns
| name = Navbox/doc
| name = Plastics
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| title = [[Plastic]]s
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| state = uncollapsed
| listclass = hlist
| cols = 3
| colwidth = 33%
| colstyle = text-align: center
| col1 = [[Polyethylene]] (PE)<br> [[Polyethylene terephthalate]] (PET or PETE)<br> [[Polyvinyl chloride]] (PVC)<br> [[Polyvinylidene chloride]] (PVDC)<br> [[Polylactic acid]] (PLA)
| col2 = [[Polypropylene]] (PP)<br> [[Polyamide]] (PA)<br> [[Polycarbonate]] (PC)<br> [[Polytetrafluoroethylene]] (PTFE)<br> [[Polyurethane]] (PU)
| col3 = [[Polystyrene]] (PS)<br> [[Polyester]]<br> [[Acrylonitrile butadiene styrene]] (ABS)<br> [[Acrylic glass|Polymethyl methacrylate]] (PMMA)<br> [[Polyoxymethylene]] (POM)
}}


| list1 =  
===Example with col<sub>n</sub>header and col<sub>n</sub>footer===
* [[Petronas Twin Towers]]
The gray background for the columns is added for illustration only.
* [[Kuala Lumpur Tower]]
{{Navbox with columns
* [[Kuala Lumpur Sentral]]
|name = Navbox with columns/doc
* [[Technology Park Malaysia]]
|state = uncollapsed
* [[Putrajaya]]
|title = col<sub>n</sub>header and col<sub>n</sub>footer example
* [[Cyberjaya]]
* [[Kuala Lumpur International Airport]]
}}


=== With two images, without groups, multiple lists ===
|colstyle = text-align:center;background:silver;
<pre style="overflow:auto;">
|colwidth = 25%
{{Navbox
| name  = Navbox/doc
| title = [[Multimedia Super Corridor|MSC Malaysia]]
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
| imageleft = [[File:Flag of Malaysia.svg|80px]]
| listclass = hlist


| list1 =  
|col1header = col1header
* [[Petronas Twin Towers]]
|col2header = col2header
* [[Kuala Lumpur Tower]]
|col3header = col3header
* [[Kuala Lumpur Sentral]]
|col4header = col4header


| list2 =  
|col1 = col1
* [[Express Rail Link]]
|col2 = col2
* [[KL-KLIA Dedicated Expressway]]
|col3 = col3
|col4 = col4


| list3 =  
|col1footer = col1footer
* [[EGovernment]]
|col2footer = col2footer
* [[MyKad]]
|col3footer = col3footer
|col4footer = col4footer


| list4 =
* [[Klang Valley]]
}}
}}
</pre>


{{Navbox
===Example with col<sub>n</sub>header using col<sub>n</sub>headercolspan===
| name = Navbox/doc
The gray background for the columns is added for illustration only.  This example shows the col<sub>n</sub>headercolspan parameter being used, but you may also use col<sub>n</sub>footercolspan to adjust the span of the footer cells.
| title = [[Multimedia Super Corridor|MSC Malaysia]]
{{Navbox with columns
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
|name = Navbox with columns/doc
| imageleft = [[File:Flag of Malaysia.svg|80px]]
|state = uncollapsed
| listclass = hlist
|title = col<sub>n</sub>header with col<sub>n</sub>colspan example


| list1 =  
|colstyle = text-align:center;background:silver;
* [[Petronas Twin Towers]]
* [[Kuala Lumpur Tower]]
* [[Kuala Lumpur Sentral]]


| list2 =  
|col1header = col1header
* [[Express Rail Link]]
|col2header = col2header (colspan=2)
* [[KL-KLIA Dedicated Expressway]]
|col4header = col4header
|col5header = col5header (colspan=3)


| list3 =  
|col2headercolspan = 2
* [[EGovernment]]
|col5headercolspan = 3
* [[MyKad]]


| list4 =  
|col1 = col1
* [[Klang Valley]]
|col2 = col2
|col3 = col3
|col4 = col4
|col5 = col5
|col6 = col6
|col7 = col7
}}
}}


=== With image, groups, above, below ===
===Example to illustrate most fields===
<pre style="overflow:auto;">
The gray background and centered text for the columns is for illustration only.  The columns default to an off-white background and left text alignment.  This example shows how you can use up to six additional groups/lists after the columns.
{{Navbox
 
| name = Navbox/doc
{{Navbox with columns
| title = [[Multimedia Super Corridor|MSC Malaysia]]
|name = Navbox with columns/doc
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
|state = uncollapsed
| above = Above text goes here
|title = Example to illustrate most fields
| listclass = hlist
|colstyle = text-align:center;background:silver;


| group1 = Centre
|col1 = col1
| list1  =  
|col2 = col2
* [[Cyberjaya]]
|col3 = col3
|col4 = col4
|col5 = col5


| group2 = Area
|col1header = col1header
| list2  =  
|col2header = col2header
* [[Klang Valley]]
|col3header = col3header
|col4header = col4header
|col5header = col5header


| group3 = Major landmarks
|col1footer = col1footer
| list3  =  
|col2footer = col2footer
* [[Petronas Twin Towers]]
|col3footer = col3footer
* [[Kuala Lumpur Tower]]
|col4footer = col4footer
* [[Kuala Lumpur Sentral]]
|col5footer = col5footer
* [[Technology Park Malaysia]]
* [[Putrajaya]]
* [[Cyberjaya]]


| group4 = Infrastructure
|group1 = group1
| list4  =  
|group2 = group2
* [[Express Rail Link]]
|group3 = group3
* [[KL-KLIA Dedicated Expressway]]
|group4 = group4
|group5 = group5
|group6 = group6


| group5 = Prime applications
|list1 = list1
| list5 =  
|list2 = list2
* [[EGovernment]]
|list3 = list3
* [[MyKad]]
|list4 = list4
|list5 = list5
|list6 = list6


| below = Website: {{URL|http://www.msc.com.my/}}
|above = above
|below = below
}}
}}
</pre>


{{Navbox
==Using child navboxes==
| name = Navbox/doc
All three types of navbox templates, namely {{tl|Navbox}}, {{tl|Navbox with columns}}, and {{tl|Navbox with collapsible groups}}, can be nested inside of one another using the <code>border</code> parameter (which is common to all three). For complex templates, it may be necessary to use nesting to achieve a desired look.
| title = [[Multimedia Super Corridor|MSC Malaysia]]
 
| image = [[File:Flag of Malaysia.svg|80px|link=|alt=]]
===Nesting Navbox with columns in itself===
| above = Above text goes here
This example shows how one can nest multiple {{tl|Navbox with columns}} templates to get the right look.  Edit this page to see the code.  There is a main {{tl|Navbox with columns}} and two additional {{tl|Navbox with columns}} templates, with the "child" option set (see code).
| listclass = hlist
{{Navbox with columns
|name = Navbox with columns/doc
|state = uncollapsed
|title = Subgroups with nesting
|colstyle = text-align:center;background:silver;


| group1 = Centre
|col1width = 33%
| list1  =  
|col2width = 17%
* [[Cyberjaya]]
|col3width = 33%
|col4width = 17%


| group2 = Area
|col1header = Col1Header
| list2  =  
|col2header = Col2Header
* [[Klang Valley]]
|col3header = Col3Header
|col4header = Col4Header


| group3 = Major landmarks
|col1 = {{Navbox with columns|child
| list3  =  
  |colwidth = 50%
* [[Petronas Twin Towers]]
  |colstyle = text-align:center;background:silver;
* [[Kuala Lumpur Tower]]
* [[Kuala Lumpur Sentral]]
* [[Technology Park Malaysia]]
* [[Putrajaya]]
* [[Cyberjaya]]


| group4 = Infrastructure
  |col1header = Col1.1Header
| list4  =  
  |col2header = Col1.2Header
* [[Express Rail Link]]
* [[KL-KLIA Dedicated Expressway]]


| group5 = Prime applications
  |col1 = Col1.1
| list5  =  
  |col2 = Col1.2
* [[EGovernment]]
}}
* [[MyKad]]


| below  = Website: {{URL|http://www.msc.com.my/}}
|col2 = Col2
}}


== Child navboxes ==
|col3 = {{Navbox with columns|child
{{Selfref|For additional examples, see the [[Template:Navbox/testcases|Navbox testcases page]].}}
  |colwidth = 33%
It is possible to place multiple navboxes within a single border with the use of the ''border'' parameter, or by specifying the first parameter to be "child".  The basic code for doing this is as follows (which adds a subgroup for the first group/list area):
  |colstyle = text-align:center;background:silver;


<pre style="overflow:auto;">
  |col1header = Col3.1Header
{{Navbox
  |col2header = Col3.2Header
|name = {{subst:PAGENAME}}
  |col3header = Col3.3Header
|title = Title


|group1 = [optional]
  |col1 = Col3.1
|list1 = {{Navbox|child
  |col2 = Col3.2
  ...child navbox parameters...
  |col3 = Col3.3
  }}
  }}


...
|col4 = Col4
}}
}}
</pre>


=== Subgroups example ===
===Nesting other Navbox forms===
{{main|Template:Navbox subgroup}}
This example shows {{tl|Navbox}}, {{tl|Navbox with collapsible groups}} and {{tl|Navbox with columns}} all working together.  Edit this page to see the code.  Note that each of the child navboxes has the first parameter set to <code>child</code>.
This example shows how subgroups can be used.  It is recommended that one use {{tl|Navbox subgroup}}, but the same result can be reached by using {{tl|Navbox}} with <code>border = child</code> or the first unnamed parameter set to <code>child</code>. The ''evenodd'' parameter is used to reverse striping in some of the subgroups in order to get all of the stripes to line up properly. To remove the striping altogether, you can set <code>liststyle = background:transparent;</code> in each of the navboxes.
{{Navbox with collapsible groups
|name = Navbox with collapsible groups
|title = Navbox, Navbox with columns, and Navbox with collapsible groups together
|selected = {{{1|}}}


{{Navbox
|group1 = [[:Category:Scouting|The Scouting Movement]]
|name = Navbox/doc
|abbr1  = movement
|image = [[File:Flag of the United States.svg|100px|link=|alt=]]
|list1  = [[Scouting]]{{·}}''[[Scouting for Boys]]''{{·}}[[Scout method]]{{·}}[[Scout Law]]{{·}}[[Scout Promise]]{{·}}[[Scout Motto]]{{·}}[[Wood Badge]]{{·}}[[Age groups in Scouting and Guiding]]{{·}}[[Cub Scout]]{{·}}[[Boy Scout]]{{·}}[[Rover Scout]]{{·}}[[Brownie (Girl Guides)|Brownie]]{{·}}[[Girl Guiding and Girl Scouting]]{{·}}[[Ranger (Girl Guide)]]{{·}}[[Jamboree (Scouting)|Jamboree]]{{·}}[[Scout Leader]]{{·}}[[World Organization of the Scout Movement|WOSM]]{{·}}[[World Association of Girl Guides and Girl Scouts|WAGGGS]]{{·}}[[Non-aligned Scouting and Scout-like organisations|Non-aligned organisations]]{{·}}[[Scouting controversy and conflict]]{{·}}[[Scouting in popular culture]]{{·}}[[List of Scouts]]{{·}}[[List of highest awards in Scouting]]
|state = uncollapsed
|title = Multiple Subgroup Example
|above = Above
|below = Below


|group1 = Group1
|list2 = {{Navbox|child
|list1 = List1
|title      = [[French colonial empires|Former French colonies]] in [[Africa]] and the [[Indian Ocean]]
|group2 = Group2
|titlestyle = background#
|list2 =  
|groupstyle = background:lavender;
{{Navbox|child
  |evenodd = swap
  |group1 = Group2.1
  |list1 = List1
  |group2 = Group2.2
  |list2 = List2
  |group3 = Group2.3
  |list3 = List3
}}


|group3 = Group3
|group1 = [[Mahgreb]]
|list3 = List3
|list1  = [[French rule in Algeria|Algeria]]{{·}} [[French Morocco|Morocco]]&nbsp;<small>([[Arguin|Arguin Island]])</small>{{·}} [[History of Tunisia|Tunisia]]


|group4 = Group4
|group2 = [[French West Africa]]
|list4 =  
|list2  = [[History of Côte d'Ivoire#French Period|Côte d'Ivoire]]{{·}} [[French Dahomey|Dahomey]]{{·}} [[French Sudan]]{{·}} [[French Guinea|Guinea]]{{·}} [[History of Mauritania#French colonization and post-colonial history|Mauritania]]{{·}} [[History of Niger#Colonization|Niger]]{{·}} [[History of Senegal|Senegal]]{{·}} [[French Upper Volta|Upper Volta]]
{{Navbox|child
  |evenodd = swap
  |group1 = Group4.1
  |list1 = List1
  |group2 = Group4.2
  |list2 = List2
  |group3 = Group4.3
  |list3 = List3
}}
}}


=== Multiple show/hides in a single container ===
|group3 = Togo
{{main|Template:Navbox with collapsible groups}}
|list3  = [[French Togoland]]{{·}} [[James Island (The Gambia)|James Island]]
The example below is generated using a regular navbox for the main container, then its list1, list2, and list3 parameters each contain another navbox, with <code>1 = child</code> set. The view (v), discuss (d), edit (e) navbar links are hidden using <code>navbar = plain</code> for each of them, or could be suppresed by just leaving out the ''name'' parameter (child navboxes do not require the name parameter to be set, unlike regular navboxes).


{{Navbox
|group4 = [[French Equatorial Africa]]
|name = Navbox/doc
|list4  = [[Colonial Chad|Chad]]{{·}} [[History of Gabon|Gabon]]{{·}} [[History of the Republic of the Congo|Middle Congo]]{{·}} [[Oubangui-Chari]]
|title = [[File:Blason France moderne.svg|x17px|link=|alt=]] [[File:Flag of France.svg|x17px|link=|alt=]] [[French colonial empire|Former French overseas empire]]
|state = uncollapsed
|list1 = {{Navbox|child
|navbar    = plain
|title      = [[French colonial empire|Former French colonies]] in [[Africa]] and the [[Indian Ocean]]
|listclass  = hlist


|group1 = [[Mahgreb]]
|group5 = [[Comoros]]
|list1 =  
|list5 = [[Anjouan]]{{·}} [[Grande Comore]]{{·}} [[Mohéli]]
* [[French rule in Algeria|Algeria]]
* [[French Morocco|Morocco]] <small>([[Arguin|Arguin Island]])</small>
* [[History of Tunisia|Tunisia]]


|group2 = [[French West Africa]]
|group6 = Southern Africa
|list2 =  
|list6 = [[History of Djibouti#French interest|French Somaliland (Djibouti)]]{{·}} [[History of Madagascar#French control|Madagascar]]{{·}} [[Mauritius|Ile de France]]{{·}} [[Seychelles]]
* [[History of Côte d'Ivoire#French Period|Côte d'Ivoire]]
}}
* [[French Dahomey|Dahomey]]
* [[French Sudan]]
* [[French Guinea|Guinea]]
* [[History of Mauritania#French colonization and post-colonial history|Mauritania]]
* [[History of Niger#Colonization|Niger]]
* [[History of Senegal|Senegal]]
* [[French Upper Volta|Upper Volta]]
* [[French Togoland]]
* [[James Island (The Gambia)|James Island]]


|group3 = [[French Equatorial Africa]]
|group3 = [[Scouting in the United Kingdom]]
  |list3  =  
|abbr3 = Scouting
* [[Colonial Chad|Chad]]
|list3  = [[The Scout Association]]{{·}}[[Girlguiding UK]]{{·}}[[Beaver Scouts]]{{·}}[[Cub Section (UK)]]{{·}}[[Venture Scout]]{{·}}[[Explorer Scouts]]{{·}}[[Brownie (Girl Guides)]]{{·}}[[Ranger (Girl Guide)]]{{·}}[[Rainbow (Girl Guides)]]{{·}}[[Scout Network]]{{·}}[[Chief Scout (United Kingdom)]]{{·}}[[Scout Counties]]{{·}}[[Scout District]]{{·}}[[Scout Section (UK)]]{{·}}[[Scout Activity Centre]]{{·}}[[Young Leaders (The Scout Association)|Young Leaders]]
* [[History of Gabon|Gabon]]
* [[History of the Republic of the Congo|Middle Congo]]
* [[Oubangui-Chari]]


|group4 = [[Comoros]]
|list4  = {{Navbox with columns|child
|list4  =  
|title = Navbox with columns nested in itself
* [[Anjouan]]
|colstyle = text-align:center;
* [[Grande Comore]]
* [[Mohéli]]
* [[History of Djibouti#French Interest|French Somaliland (Djibouti)]]
* [[History of Madagascar#French control|Madagascar]]
* [[Mauritius|Ile de France]]
* [[Seychelles]]
}}


|list2 = {{Navbox|child
|col1width = 33%
|navbar    = plain
|col2width = 17%
|title      = [[French colonial empire|Former French colonies]] in the [[Americas]]
|col3width = 33%
|listclass  = hlist
|col4width = 17%


|list1 =  
|col1header = Col1Header
* [[New France]]{{spaces|2}}<small>([[Acadia]], [[Louisiana (New France)|Louisiana]], [[Canada, New France|Canada]], [[Newfoundland (island)|Terre Neuve]]) 1655–1763 </small>
|col2header = Col2Header
|col3header = Col3Header
|col4header = Col4Header


|list2 =  
|col1 = {{Navbox with columns|child
* [[Inini]]
  |colwidth = 50%
* [[Berbice]]
  |colstyle = text-align:center;
* [[Saint-Domingue]] <small>([[Haiti]])</small>
* [[Tobago]]
* [[History of the British Virgin Islands|Virgin Islands]]
* [[France Antarctique]]
* [[France Équinoxiale]]


|below      = [[French West India Company]]
  |col1header = Col1.1Header
}}
  |col2header = Col1.2Header


|list3 = {{Navbox|child
  |col1 = Col1.1
|navbar    = plain
  |col2 = Col1.2
|title      = [[French colonial empire|Former French colonies]] in [[Asia]] and [[Oceania]]
  }}
  |listclass  = hlist


|group1 = [[French India]]
|col2 = Col2
|list1  =
* [[Chandernagor]]
* [[Coromandel Coast]]
* [[History of Chennai|Madras]]
* [[Mahé, India|Mahé]]
* [[History of Pondicherry|Pondichéry]]
* [[Karaikal]]
* [[Yanam (India)|Yanaon]]


|group2 = [[French Indochina]]
|col3 = {{Navbox with columns|child
|list2  =  
  |colwidth = 33%
* [[Colonial Cambodia|Cambodia]]
  |colstyle = text-align:center;
* [[History of Laos to 1945#French Laos|Laos]]
* [[French Indochina|Vietnam]] <small>([[Annam (French colony)|Annam]], [[Cochinchina]], [[Tonkin]])</small>


|group3 = Other Asian
  |col1header = Col3.1Header
|list3  =  
  |col2header = Col3.2Header
* [[Alawite State|Alaouites]]
  |col3header = Col3.3Header
* [[Republic of Hatay|Alexandretta-Hatay]]
* [[Sri Lanka|Ceylon]]
* [[Kwangchowan]]


|group4 = [[Oceania]]
  |col1 = Col3.1
|list4  =  
  |col2 = Col3.2
* [[New Hebrides]] [[History of Vanuatu|(Vanuatu)]]
  |col3 = Col3.3
}}


|below      = [[French East India Company]]
|col4 = Col4
}}
}}
}}
}}


== Relationship with other Navbox templates ==
==Footnote==
This navbox template is specifically designed to work in conjunction with two other sister templates: {{tl|Navbox with columns}} and {{tl|Navbox with collapsible groups}}.  All three of these templates share common parameters for consistency and ease of use (such parameters are marked with an asterisk <nowiki>(*)</nowiki> in the [[#Parameter descriptions|parameter descriptions]] list above).  Most importantly, each template can be used as a child of one another (by using the {{para|border|child}} parameter, or by specifying the first unnamed parameter to be <code>child</code>. For example: <code><nowiki>{{Navbox|child ...}}</nowiki></code>, <code><nowiki>{{Navbox with columns|child ...}}</nowiki></code> or <code><nowiki>{{Navbox with collapsible groups|child ...}}</nowiki></code>.
<references/>
 
== Technical details ==
*This template uses CSS classes for most of its looks, thus it is fully skinnable.
*Internally this meta template uses HTML markup instead of wiki markup for the table code. That is the usual way we make meta templates since wiki markup has several drawbacks. For instance it makes it harder to use [[m:Help:ParserFunctions|parser functions]] and special characters in parameters.
*For more technical details see the [[{{TALKPAGENAME}}|talk page]], the CSS classes in [[MediaWiki:common.css]] and the collapsible table used to hide the box in [[MediaWiki:common.js]].
 
=== Intricacies ===
*The 2px wide border between groups and lists is drawn using the border-left property of the list cell.  Thus, if you wish to change the background color of the template (for example <code>bodystyle = background:purple;</code>), then you'll need to make the border-left-color match the background color (i.e. <code>liststyle = border-left-color:purple;</code>).  If you wish to have a border around each list cell, then the 2px border between the list cells and group cells will disappear; you'll have to come up with your own solution.
*The list cell width is initially set to 100%.  Thus, if you wish to manually set the width of group cells, you'll need to also specify the liststyle to have width:auto.  If you wish to set the group width and use images, it's up to you to figure out the CSS in the groupstyle, liststyle, imagestyle, and imageleftstyle parameters to get everything to work correctly.  Example of setting group width:
::<code>groupstyle = width:10em;</code>
::<code>liststyle = width:auto;</code>
*Adjacent navboxes have only a 1 pixel border between them (except in IE6, which doesn't support the necessary CSS).  If you set the top or bottom margin of <code>style/bodystyle</code>, then this will not work.
*The default margin-left and margin-right of the outer navbox table are set to "auto;".  If you wish to use navbox as a float, you need to manually set the margin-left and margin-right values, because the auto margins interfere with the float option.  For example, add the following code to use the navbox as a float:
::<code>style = width:22em;float:right;margin-left:1em;margin-right:0em;</code>
 
=== Copying to other projects or wikis? ===
Using this template on other wikis requires [[HTML Tidy]] to be turned on. A version that does not require Tidy can be found at [[Wikipedia:WikiProject Transwiki/Template:Navbox]]. (That version generally shouldn't be used here on the English Wikipedia.) More detailed information on copying {{tlf|Navbox}} to other wikis can be found on the [[Template talk:Navbox|talk page]].
 
===Known issues===
#If the heading of the navbox spans more than one line, the second line will be displayed to the right of center.  This can be avoided by hard-coding linebreaks with {{tag|br|single|params=clear="all"}}.
#Excessive use of the '''unsubstituted''' {{tlx|•}} template as a delimiter, can in extreme cases cause the wiki page rendering to fail&nbsp;– there is a limit to the number of templates that can be used on a page (example [[Ketamine]] where the inclusion of eleven Navboxes with hundreds of bullets caused the page load not to complete, only the substitution of the bullets in those navboxes cured the problem). Use of the <code>hlist</code> class avoids the delimiter transclusion issue altogether, as the delimiters are rendered via CSS.


== See also ==
== See also ==
* {{tl|Navbar}} – Used for the navigation links in navbox.
{{Navigational templates}}
* {{tl|Nobold}} – To display text at normal font-weight within a context where the default font-weight is bold, e.g. header cells in tables.
* {{tl|Sidebar}} – Vertically-aligned navigation (navbox) templates
* {{strikethrough|{{tl|Nowrap begin}} – The recommended format for adding bullets, pipes, or dashes between list items.}} Deprecated; use the <code>hlist</code> class.
* {{strikethrough|{{tn|·}} and {{tn|•}} – The dot and bullet commonly used to separate items in Navbox lists.}} Deprecated; use the <code>hlist</code> class.
* {{strikethrough|{{tl|Flatlist}} – An accessible and semantically valid method (using an HTML list) of separating items in Navbox lists.}} Deprecated; use the <code>hlist</code> class.
* [[Template:Navbox/testcases]] – For additional examples of template code
* [[Wikipedia:Line break handling]] – The how-to guide about how to handle word wraps (line breaks) on Wikipedia, such as the wrapping of the link lists used in navboxes.
 
{{Navigation templates}}


<includeonly>
<includeonly>
<!--Categories-->
[[Category:Navigational boxes| ]]


<!--Other languages-->
[[ar:قالب:Navbox with columns]]
[[bn:টেমপ্লেট:Navbox with columns]]
[[bs:Šablon:Navkutija sa kolonama]]
[[ca:Plantilla:Navbox with columns]]
[[cs:Šablona:Navbox se sloupci]]
[[eo:Ŝablono:Navigilo kun kolumnoj]]
[[fr:Modèle:Méta palette de navigation avec colonnes]]
[[hy:Կաղապար:Սյունակներով նավարկման աղյուսակ]]
[[ko:틀:안내 다단]]
[[hsb:Předłoha:Nawitabela ze špaltami]]
[[ja:Template:Navbox with columns]]
[[ku:Şablon:Navbox with columns]]
[[mk:Шаблон:Navbox with columns]]
[[pl:Szablon:Navbox z kolumnami]]
[[pt:Predefinição:Navbox with columns]]
[[ro:Format:Casetă de navigare cu coloane]]
[[ru:Шаблон:Навигационная таблица с колонками]]
[[sv:Mall:Navbox with columns]]
[[uk:Шаблон:Navbox with columns]]
[[tr:Şablon:Dolaşım dikeç]]
[[vi:Tiêu bản:Navbox with columns]]
[[zh:Template:Navbox with columns]]
</includeonly>
</includeonly>

Latest revision as of 12:47, 15 January 2012

A navigation box that presents its content in columns. Originally intended to provide a relatively straightforward means to align links prefixed by flag icons, e.g. in templates offering links to country articles.

Basic syntax

Only required parameters and colwidth included.

{{Navbox with columns
|name       = {{subst:PAGENAME}}
|title      = 
|titleclass = 
|bodyclass  = 
|colwidth =  <!--(to set a default width for each column,
                  preferably in a proportional unit such as 'em'*)-->
|col1  = 
|col2  = 
}}
* See Em (typography). Using proportional units means the template should still be displayed correctly across a range of browser font-sizes. If colwidth not specified, a default 10em is used.

Parameters

Setup parameters

name[1]
The name of the template. The name of this template, for example, is "Navbox with columns".
state[1]
Possible values are collapsed, uncollapsed, plain, off, and the default autocollapse. See {{Navbox}} for more information.
navbar[1]
Possible values are plain, off, and the default value of blank. See {{Navbox}} for more information.
border[1]
Possible values are child, none, and the default value of blank. Set to child if you wish to use the navbox inside of another navbox; with this option, the child navbox is borderless and fits snuggly inside of its parent navbox. The parent navbox may be the list area of {{Navbox}}, a columns of another {{Navbox with columns}}, or a section of {{Navbox with collapsible groups}}. See {{Navbox}} for more information and examples.

Basic data parameters

title[1]
The title of the template, displayed centered in the titlebar at the top of the template.
above[1]
Text or other elements to appear above the columns.
image[1]
Image to the right of all of the columns.
imageleft[1]
Image to the left of all of the columns.
below[1]
Text or other elements to appear below the columns.

Style parameters

style[1]
CSS style/s to apply to the template's body (i.e. including space not used by columns)
titlestyle[1]
CSS style/s to apply to titlebar; usually background:color (background defaults to NavHead default).
abovestyle[1]
belowstyle[1]
CSS style/s to apply to the above and below parameters, respectively.
basestyle[1]
CSS style/s to apply to the title, above, and below, parameters, all at the same time.
imagestyle[1]
CSS style/s to apply to the image parameter.
imageleftstyle[1]
CSS style/s to apply to the imageleft parameter
colstyle
CSS style/s to apply across all columns; if used, usually background:color per titlestyle above.
oddcolstyle
evencolstyle
CSS style/s to apply to all odd/even-numbered columns, respectively.
colnstyle
CSS style/s to apply to the nth column only.
colheaderstyle
CSS style/s to apply to all column headers.
colnheaderstyle
CSS style/s to apply to the nth column header.
colnfooterstyle
CSS style/s to apply to the nth column footer cell.

Columns parameters

colwidth
Width, preferably in a proportional unit such as 'em', or as a percentage, used for each column whose width not specified by colNwidth below. Defaults to 10em. Examples:
colwidth = 15em
colwidth = 25%
fullwidth
If set to anything, then the total width of the columns are scaled linearly to make the sum of the widths 100%. A rather advanced parameter, this usually need not be used and should be left blank. If a colheader or colfooter is used, then fullwidth is used automatically. Example:
fullwidth = true
padding
Padding before first column, preferably in a proportional unit. Defaults to 5em. Padding is disabled by setting it to 0 (or 0em, or 0%).
colnwidth
The nth column's width (overrides colwidth above).
coln
The content of the nth column. If any columns are used, then col1 is required. There can be a maximum of 20 columns.
colnheader
A header cell for the nth column that appears above the column. See below for examples.
colnfooter
A footer cell that appears below the nth column.
colnheadercolspan
A number specifying how many columns the nth column header should span. It defaults to 1. If it is greater than one, then do not specify column headers that it covers. For example, if col1headercolspan = 3, then leave col2header and col3header blank.
colnfootercolspan
A number specifying how many columns the nth column footer should span. It defaults to 1. If it is greater than one, then do not specify column footers that it covers. For example, if col1footercolspan = 3, then leave col2footer and col3footer blank.

Additional groups/lists

You may wish to add a few extra groups and/or lists below the columns. The following parameters are given to provide such functionality. See {{Navbox}} for a more complete description of how they work, and for more examples.

groupn[1]
Allows up to 6 additional groups to go along with the lists below the columns.
listn[1]
Allows up to 6 additional lists below the columns.
groupstyle[1]
The general CSS style/s for the groups.
groupnstyle
CSS style/s for the nth group parameter.[1]
liststyle[1]
The general CSS style/s for the lists.
listnstyle
CSS style/s for the nth list parameter.
listpadding[1]
Amount of padding to have in each list cell.
oddstyle
evenstyle
Applies to odd/even list numbers. Overrules styles defined by liststyle. The default behavior is to add striped colors (white and gray) to odd/even rows, respectively, in order to improve readability. These should not be changed except in extraordinary circumstances.
evenodd [swap, even, odd, off]
See {{Navbox}} for description.

Microformats

bodyclass
This parameter is inserted into the "class" attribute for the infobox as a whole.
titleclass
This parameter is inserted into the "class" attribute for the infobox's title caption.

This template supports the addition of microformat information. This is done by adding "class" attributes to various data cells, indicating what kind of information is contained within. To flag a navbox as containing hCard information about a person, for example, add the following parameter:

|bodyclass = vcard

and

|titleclass = fn

or (for example):

|title = The books of <span class="fn">[[Iain Banks]]</span>

...and so forth.

See Wikipedia:WikiProject Microformats for more information on adding microformat information to Wikipedia, and microformat for more information on microformats in general.

Examples

Basic example

{{Navbox with columns
|name    = East Asia Summit (EAS)
|title   = Member states of the [[East Asia Summit|East Asia Summit (EAS)]]
|width   = 18.25em
|padding = 10em

|above = ''This is where the {{{above}}} would appear.''

|col1 = {{AUS}}<br> {{BRU}}<br> {{flag|CHN|name=PR China}}<br> {{CAM}}
|col2 = {{IND}}<br> {{IDN}}<br> {{JPN}}<br> {{LAO}}
|col3 = {{MAS}}<br> {{MMR}}<br> {{NZL}}<br> {{PHI}}
|col4width = 17em
|col4 = {{SIN}}<br> {{KOR}}<br> {{THA}}<br> {{VIE}}

|below = '''Potential future members'''{{spaces|6}}{{TLS}}{{spaces|3}}{{RUS}}
}}

Example with percentage widths

{{Navbox with columns
| name = Plastics
| title = [[Plastic]]s
| colwidth = 33%
| colstyle = text-align: center
| col1 = [[Polyethylene]] (PE)<br> [[Polyethylene terephthalate]] (PET or PETE)<br> [[Polyvinyl chloride]] (PVC)<br> [[Polyvinylidene chloride]] (PVDC)<br> [[Polylactic acid]] (PLA)
| col2 = [[Polypropylene]] (PP)<br> [[Polyamide]] (PA)<br> [[Polycarbonate]] (PC)<br> [[Polytetrafluoroethylene]] (PTFE)<br> [[Polyurethane]] (PU)
| col3 = [[Polystyrene]] (PS)<br> [[Polyester]]<br> [[Acrylonitrile butadiene styrene]] (ABS)<br> [[Acrylic glass|Polymethyl methacrylate]] (PMMA)<br> [[Polyoxymethylene]] (POM)
}}

Example with colnheader and colnfooter

The gray background for the columns is added for illustration only.

Example with colnheader using colnheadercolspan

The gray background for the columns is added for illustration only. This example shows the colnheadercolspan parameter being used, but you may also use colnfootercolspan to adjust the span of the footer cells.

Example to illustrate most fields

The gray background and centered text for the columns is for illustration only. The columns default to an off-white background and left text alignment. This example shows how you can use up to six additional groups/lists after the columns.

Using child navboxes

All three types of navbox templates, namely {{Navbox}}, {{Navbox with columns}}, and {{Navbox with collapsible groups}}, can be nested inside of one another using the border parameter (which is common to all three). For complex templates, it may be necessary to use nesting to achieve a desired look.

Nesting Navbox with columns in itself

This example shows how one can nest multiple {{Navbox with columns}} templates to get the right look. Edit this page to see the code. There is a main {{Navbox with columns}} and two additional {{Navbox with columns}} templates, with the "child" option set (see code).

Nesting other Navbox forms

This example shows {{Navbox}}, {{Navbox with collapsible groups}} and {{Navbox with columns}} all working together. Edit this page to see the code. Note that each of the child navboxes has the first parameter set to child. Template:Navbox with collapsible groups

Footnote

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20 1.21 Parameters marked with a footnote [1] are parameters in common with the sister templates {{Navbox}} and {{Navbox with collapsible groups}}. A much more complete description of those parameters is available at {{Navbox}}.

See also

Template:Navigational templates