Jump to content

Template:Columns-list

From Wikidata
Documentation icon Template documentation[view · edit · history · purge ]

This template, {{Columns-list}}, formats a normal list to be displayed with columns. It is a wrapper for {{Div col}}, except it wraps the template by allowing for the content to be within a single template call rather than sandwiched between two individual template transclusions.

Usage

[edit]
CSS3 multiple column layout
browser support
Internet
Explorer
Firefox Safari Chrome Opera
≤ 9 ≤ 1.0 ≤ 2 N/A ≤ 11.0
10
(2012)
≥ 1.5
(2005)
≥ 3
(2007)
≥ 1
(2008)
≥ 11.1
(2011)

This template uses CSS3 multiple-column layout, which is not supported by all web browsers.

The width of each column may be specified using the |colwidth= parameter with a value in em.

{{Columns-list|colwidth=width|
* Text (usually a list)
}}

Here, width specifies the width of the columns and determines (dynamically) the number of possible columns based on viewport width; more columns being shown on wider displays.

If |colwidth= is not specified, the default width of 30em will be used.

Examples

[edit]

Here is one example:

{{Columns-list|colwidth=35em|
* {{Q|23}}
* {{Q|11806}}
* {{Q|11812}}
* {{Q|11813}}
* {{Q|11815}}
}}

…which when parsed, displays as…

HTML classes and CSS styles can also be added with the |class= and |style= parameters. For example:

{{Columns-list|colwidth=15em|style=font-style: italic; width: 600px|
* {{Q|1329381}}
* {{Q|1072582}}
* {{Q|1192488}}
* {{Q|903609}}
* {{Q|7744910}}
* {{Q|958125}}
* {{Q|44935}}
* {{Q|1888621}}
* {{Q|373205}}
* {{Q|1036921}}
}}

…which renders as…

This template also works with ordered (a/k/a "numbered") lists as its content, for example:

{{Columns-list|colwidth=35em|
# {{Q|23}}
# {{Q|11806}}
# {{Q|11812}}
# {{Q|11813}}
# {{Q|11815}}
}}

The template, in fact, works with everything, since all it does is wrap the text provided around a block to be divided into columns by CSS. Do not stop at wikitext lists – more advanced lists generated by HTML-based templates will work too!

Error messages

[edit]

Use of the now-unsupported parameter |cols=, or use of the first unnamed parameter (aka |1=) along with |2= or a second unnamed parameter for the template's content, will generate a red error message. To fix this error, use |colwidth= instead of attempting to explicitly specify the number of columns.

The presence of an equality symbol (=) within the template's content can also cause display problems and red error messages. To fix this, add |1= in front of the template's content.

TemplateData

[edit]
This is the TemplateData documentation for this template used by VisualEditor and other tools.

Columns-list

Formats a list to display split into columns. It is a wrapper for {{Div col}}, wrapping that template to allow for the content to be within the template call rather than sandwiched between a template above and below

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Content1

Specifies the content to divide into columns

Stringoptional
Columns / Column widthcolwidth

Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays.

Default
30
Example
20em
Stringoptional
CSS stylestyle

Specifies any custom styling.

Example
width: 600px; font-style: italic;
Stringoptional
HTML classclass

Specifies any class or multiple space-delimited classes.

Example
plainlist nowrap
Stringoptional

See also

[edit]