Template:Div col

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Documentation icon Template documentation[view] [edit] [history] [purge]
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)

{{div col}}, together with {{div col end}}, is used to make a list into columns, with the option of specifying a smaller font. It has the advantage over other column templates (i.e. {{col-begin}}) that it automatically breaks each column to an equal space, so you do not manually have to find the "half way" point on two columns, for instance.

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

Usage

cols = (or {{{1}}}) 
Specifies the number of columns. Defaults to 2 columns. This feature is now deprecated in favor of the colwidth option described below, which is better suited to flexible formatting for a variety of display screen sizes, ranging from mobile phones and tablets to wide-screen "cinema" displays.
colwidth = (or {{{2}}}) 
Specifies the minimum width of columns, and determines automatically the number of columns based on screen width; more columns will be shown on wider displays. This overrides the cols= setting.
rules = 
produces vertical rules between the columns if set to yes or custom CSS, for example 1px dashed blue;.
small = 
Specifies small font size (90%) if set to yes.
style = 
Specify any custom styling.

Examples

{{Div col}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
Produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col|3}}
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}
Produces
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
{{Div col||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

See main template page.

See also


TemplateData

This is the TemplateData documentation for the template used by the new VisualEditor.

Div col

Breaks a list into columns. It automatically breaks each column to an equal space, so you do not manually have to find the half way point on two columns. The list is closed with {{div col end}}.

Template parameters
Parameter Description Type Default Status
cols cols1 Specifies the number of columns. string 2 optional
colwidth colwidth2 Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays. This overrides the 'cols' setting. string empty optional
rules rules Produces vertical rules between the columns if set to yes. string empty optional
small small Specifies small font size (90%) if set to yes. string empty optional
style style Specify any custom styling. string empty optional