Jump to content

Template:Div col

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

This template, together with {{Div col end}}, is used to display a list in columns, with the option of specifying a smaller font as well. It automatically breaks each column into an equal space, so you do not manually have to find the "halfway" point for two columns, for instance.

This template can create multiple columns in web browsers which support one of the following CSS properties:

  • column-count (for CSS3 compliant browsers; see CSS3 module: Multi-column layout)
  • -moz-column-count (for Mozilla/Gecko based browsers such as Firefox)
  • -webkit-column-count (for WebKit based browsers such as Safari and Google Chrome)

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)

Examples

[edit]
{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

…produces…

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|colwidth=20em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

…produces…

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|colwidth=10em}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

…produces…

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|rules=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

…produces…

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|small=yes}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}

…produces…

  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h

TemplateData

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

Div col

Displays a list in several vertical columns

Template parameters[Edit template data]

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Column widthcolwidth

Specifies the width of columns, and determines dynamically the number of columns based on viewport width; more columns will be shown on wider displays. Must be a valid CSS length value with unit suffix.

Default
30em
Example
14em
Lineoptional
Listcontent 1

Provide the list to be split into columns as the value of this parameter, using standard wiki markup

Contentrequired
Lined column breaksrules

Produces vertical rules between the columns if set to 'yes'

Default
no
Example
yes
Booleanoptional
Small fontsmall

Specifies font size of 90% if set to 'yes'

Default
no
Example
yes
Booleanoptional
Custom CSS stylesstyle

Specify any custom CSS styling, terminating declarations with semicolons

Example
line-height: 1.5;
Lineoptional
Custom class attributesclass

Specify custom CSS classes for the wrapper box around the list, space-delimited

Lineoptional
Column gap widthgap

Specify a custom column gap, must be a valid CSS length value with unit suffix

Default
auto
Example
8rem
Lineoptional

See also

[edit]