Template:Div col/doc

From Wayne County, Ohio Online Resource Center
< Template:Div col
Revision as of 17:04, 25 August 2014 by Jferrell (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
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}} (or {{start div col}}), together with {{div col end}} (or {{end div col}}), is used to make a list into columns. It automatically breaks each column into an equal space, meaning, for instance, it isn't necessary to work out the halfway point between two columns. The template also offers options to set a smaller (90%) font-size (|small=yes), place vertical lines ("rules") between the columns (|rules=) and to add other custom styling (|style=).

{{Div col}} can create multiple columns in web browsers which support one of the following CSS properties:

Usage

|cols= or first unnamed parameter
(Now deprecated, as colwidth below is better suited to flexible formatting for a variety of display screen sizes (from mobile phones, tablets, etc to widescreen cinema-style displays))
Specifies the number of columns (default 2).
|colwidth= or second unnamed parameter
Specifies the minimum width of the columns and determines automatically the number of columns based on screen width (i.e. more columns will be shown on wider displays). Overrides cols.
|rules=
Adds vertical lines ("rules") between the columns if set to yes or some CSS styling (e.g. 1px dashed blue;).
|small=
Specifies small font size (90%) if set to yes.
|style=
CSS styling to apply to the columns.

Examples

{{Div col}}   [or {{Start div col}}]
* a
* b
* c
* d
* e
* f
* g
* h
{{Div col end}}   [or {{End div col}}]
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

Column-generating template families

Family
Handles wiki
 table code?dagger
Start template Break between columns End template
"Col" {{Col-begin}}
or {{Col-begin-small}}
{{Col-break}}
{{Col-6}} or use {{Col-break|width=16.6%}},
i.e. with width ≈ 100%/6.
{{Col-7}} or use {{Col-break|width=14.2%}},
i.e. with width ≈ 100%/7.
{{Col-8}} or use {{Col-break|width=12.5%}},
i.e. with width = 100%/8.
For nine or even more columns, use {{Col-break|width=[W]%}},
where [W] ≈ 100 divided by the number of columns desired.
{{Col-end}}
or {{End}}
"Col-float" Green tickY {{Col-float}} {{Col-float-break}} {{Col-float-end}}
"Columns" Green tickY {{Columns}}
"Columns-start" Green tickY {{Columns-start}} {{Column}} {{Columns-end}}
"Div col" Green tickY {{Div col}}
or {{Columns-list}}
{{Div col end}}
"Multicol" {{Multicol}} {{Multicol-break}} {{Multicol-end}}
"TMB" {{Top}} {{Mid}} {{Bottom}}

dagger i.e. can the columns handle the wiki markup {| | || |- |} used to create tables? If not, templates that produce these elements (such as {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) and/or HTML tags (<table>...</table>, <tr>...</tr>, etc) will need to be used instead.