Template:Div col/doc
This template is currently protected from editing as it is a high-use template. Edits made to it will affect many pages. Please discuss changes on the talk page before implementing them. Test changes in the template's /sandbox or in your sandbox. |
Overview
{{Div col}} formats a bulleted or numbered list into columns that wrap based on screen and browser viewport size. It automatically breaks each column into an equal space, meaning, for instance, it is not necessary to work out the halfway point, or the on-third & two-thirds points between two columns. The use of {{div col}} can make long lists with short entries easier to readers to navigate.
Usage
The most basic usage of {{div col}} consists of enclosing a formatted list inside {{div col}} and {{div col end}}. For example:
{{div col}} * a * b * c * d * e * f * g * h {{div col end}}
Produces:
- a
- b
- c
- d
- e
- f
- g
- h
Parameters
- colwidth: Specifies the minimum width of the columns so that the number of columns is automatically based on screen width (that is, more columns will be shown on wider displays). If no value is supplied, the template uses a default of 30em. The width can be specified in any CSS unit of measure, for instance, the em (about the width of the capital "M" of the displayed typeface), e.g., colwidth=20em.
- rules: Adds vertical lines ("rules") between the columns if set to yes.
- gap: Specifies the space between the content of adjacent columns, in any valid CSS width unit, e.g., gap=2em. The default spacing (set by browser) is 1em.
- class: An HTML class, or multiple space-delimited classes, to apply to the columns.
- style: CSS styling to apply to the columns.
- small: Sets font size to 90%.
- content: Species the content in the columns. If content is specified, closing the template with {{div col end}} is not needed.
Examples
TemplateData
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 provided by |content= or closed with {{div col end}}.
Parameter | Description | Type | Status | |
---|---|---|---|---|
cols | cols 1 | Specifies the number of columns.
| Number | deprecated |
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 |
content | content | Specifies the content. | String | optional |
Redirects
Copyright
This page uses content originally from Wikipedia's Template:Div col/doc page; Wikipedia content is licensed under a Creative Commons Attribution-ShareAlike License 4.0. (view page authors).
|