Template:Navigation with columns

From Wikipedia, the free encyclopedia

This high-risk template has been protected from editing to prevent vandalism. (protection log). Please discuss changes on the talk page or request unprotection. You may use {{editprotected}} on the talk page to ask for an administrator to make an edit for you.

The template documentation below is transcluded from Template:Navigation with columns/doc [edit]

Version of {{Navigation}} that presents its content in columns. Originally intended to provide a straightforward means to align links prefixed by flag icons, e.g. in templates offering links to country articles.

Parameters

Required parameters in bold.

name The name of the template. The name of this template, for example, is "Navigation with columns".
title The title of the template, displayed centered in the titlebar at the top of the template.
titlebkg Background color of titlebar (defaults to NavHead default, currently #efefef).
above (or top) Text or other elements to appear above the columns.
cols The number of columns to be used (maximum 8, minimum 2).
colsbkg Background color for columns (defaults to transparent).
width Width, in pixels without "px" suffix1, used for each column whose width not specified by colNwidth below.
padding Padding before first column (default calculated per "Calculations used" section below).
col1 First column's content.
col1width First column's width (if not width above).
col2 Second column's content.
col2width Second column's width (if not width above).
col3 Third column's content.
col3width Third column's width (if not width above).
...... ......
col8 Sixth and final column's content.
col8width Sixth and final column's width (if not width above).
below (or bottom) Text or other elements to appear below the columns.
cat (or category) The category or categories to which a page including the template will become a member.

1 Pixels without "px" suffix required as this parameter's value used to calculate padding before columns (in lieu of padding parameter).

Blank syntax

Only required parameters included.

{{Navigation with columns
|name  = {{subst:PAGENAME}}
|title = 
|cols  = 
|width = 
|col1  = 
|col2  = 
}}

Example

Code

{{Navigation with columns
|name  = (Countries bordering the Mediterranean Sea)
|title = [[List of countries|Countries]] bordering the [[Mediterranean Sea]]
|cols  = 4
|width = 185  <!--185 pixels-->
|above = ''(This is where the {{{above}}} or {{{top}}} parameter would appear.)''

|col1 = {{flagcountry|Albania}}<br/> {{flagcountry|Algeria}}<br/> 
{{flagcountry|Bosnia and Herzegovina}}<br/> {{flagcountry|Croatia}}<br/> 
{{flagcountry|Cyprus}}<br/> {{flagcountry|Egypt}}

|col2 = {{flagcountry|France}}<br/> {{flagcountry|Greece}}<br/> 
{{flagcountry|Israel}}<br/> {{flagcountry|Italy}}<br/> {{flagcountry|Lebanon}}

|col3 = {{flagcountry|Libya}}<br/> {{flagcountry|Malta}}<br/> 
{{flagcountry|Monaco}}<br/> {{flagcountry|Montenegro}}<br/> {{flagcountry|Morocco}}

|col4 = {{flagcountry|Slovenia}}<br/> {{flagcountry|Spain}}<br/> 
{{flagcountry|Syria}}<br/> {{flagcountry|Tunisia}}<br/> {{flagcountry|Turkey}}

|below = Dependent and other territories not included.
}}

Result


Calculations used

            ┌--------------------------------centered table-------------------------------┐

columns:    |   (padding)   | ┌---------------|---------{{{cols}}}------|---------------┐ |
 widths:    | {{{width}}}/2 | {{{width}}} or  | {{{width}}} or  |  ...  | {{{width}}} or  |
                            | {{{col1width}}} | {{{col2width}}} |  ...  | {{{colNwidth}}} |

See also

Navigation template comparison
view talk edit
collapsible Header color Image Groups Style
parameter
Example
{{Navigation}} NavFrame NavHead No No No {{OPEC}}
{{Navigation with image}} NavFrame NavHead Left/right of body No No {{HolmesNovels}}
{{Navigation with columns}} NavFrame NavHead No No No
{{Dynamic navigation box}} collapsible navbox No No Yes {{CSUHeads}}
{{Dynamic navigation box with image}} NavFrame NavHead Upper left No No {{SlovakPMs}}
{{Navbox generic}} collapsible navbox Right-hand side Yes Yes {{Dilbert}}
{{Navbox generic with image}} collapsible navbox Right-hand side Yes Yes {{Jewish life}}
{{NavigationBox}} No navbox Right of title+body No No {{EPA}}
{{Commons:NavigationBox}} No #ccccff Right of title+body No No
{{Commons:Dynamic navigation box}} NavFrame #ccccff No No No
{{Commons:Dynamic navigation box with image}} NavFrame #ccccff Upper left No No
The background color for the header or title is inherited from the class listed below. The templates have titlebkg parameters that override the default.
Collapsible attributes
Type CSS classes Collapses when Custom
initial state
Nesting Header
color
Font size
NavFrame div NavFrame, NavHead, NavContent 3+ of the same No Yes #ccccff 95%
Collapsible table collapsible, navbox 2+ of the same Yes No #ccccff 90%

For the technically minded, see Common.css and Common.js.