Template:Div col: Difference between revisions
(Created page with "<includeonly><div class="div-col columns <!-- -->{{#if: {{{colwidth|{{{2|}}}}}} | column-width | column-count column-count-{{{cols|{{#if:1|{{{1|2}}}}}}}} }}" style="<...") |
mNo edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 19: | Line 19: | ||
|{{{content}}}</div>}}<!-- Inventory how many pages use small=yes | |{{{content}}}</div>}}<!-- Inventory how many pages use small=yes | ||
-->{{#ifeq: {{{small|}}}|yes | -->{{#ifeq: {{{small|}}}|yes | ||
|[[Category:Pages using div col with small parameter]]}}</includeonly><noinclude> | |<!--[[Category:Pages using div col with small parameter]]-->}}</includeonly><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
</noinclude> | </noinclude> |
Latest revision as of 18:20, 16 April 2016
File:Information icon4.svg | Columns are not supported by some older browsers, most notably Internet Explorer 9 and below and Opera 11.0 and below. See this page for more information. |
Property | Internet Explorer | Firefox | Safari | Chrome | Opera |
---|---|---|---|---|---|
column-width column-count |
Template:Yes | Template:Yes | Template:Yes | Template:Yes | Template:Yes |
columns | Template:Yes | Template:Yes | Template:Yes | Template:Yes | Template:Yes |
break-before break-after break-inside |
Template:Yes | No | No | No | Template:Yes |
{{Div col}}, together with {{div col end}}, 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:
- 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
- Template:S 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. Specified in any CSS unit, for instance in em, about the width of a capital "M", e.g,
colwidth=20em
|rules=
- Adds vertical lines ("rules") between the columns if set to
yes
or some CSS styling (e.g.1px dashed blue;
). |gap=
- Specifies the space between the content of adjacent columns. Specified in any CSS unit, e.g,
gap=2em
. The default spacing is 1em. |style=
- CSS styling to apply to the columns.
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
TemplateData for 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}}.
Parameter | Description | Type | Status | |
---|---|---|---|---|
cols | cols 1 | Specifies the number of columns.
| String | optional |
colwidth | colwidth 2 | 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 | optional |
rules | rules | Produces vertical rules between the columns if set to yes. | String | optional |
gap | gap | Specifies the space between the content of adjacent columns. | String | optional |
style | style | Specifies any custom styling. | String | optional |
Redirects
{{Div col start}}
{{Colbegin}}
(but not{{Col begin}}
){{Cols}}
See also
Template:Column-generating template families
The above documentation is transcluded from Template:Div col/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |