Template:Columns-list
| Uses Lua: |
This template, {{Columns-list}}, formats a normal list to be displayed with columns. It is a wrapper for {{Div col}}, except it wraps the template by allowing for the content to be within a single template call rather than sandwiched between two individual template transclusions.
Usage
[edit]| 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) |
This template uses CSS3 multiple-column layout, which is not supported by all web browsers.
The width of each column may be specified using the |colwidth= parameter with a value in em.
{{Columns-list|colwidth=width|
* Text (usually a list)
}}
Here, width specifies the width of the columns and determines (dynamically) the number of possible columns based on viewport width; more columns being shown on wider displays.
If |colwidth= is not specified, the default width of 30em will be used.
Examples
[edit]Here is one example:
{{Columns-list|colwidth=35em|
* {{Q|23}}
* {{Q|11806}}
* {{Q|11812}}
* {{Q|11813}}
* {{Q|11815}}
}}
…which when parsed, displays as…
HTML classes and CSS styles can also be added with the |class= and |style= parameters. For example:
{{Columns-list|colwidth=15em|style=font-style: italic; width: 600px|
* {{Q|1329381}}
* {{Q|1072582}}
* {{Q|1192488}}
* {{Q|903609}}
* {{Q|7744910}}
* {{Q|958125}}
* {{Q|44935}}
* {{Q|1888621}}
* {{Q|373205}}
* {{Q|1036921}}
}}
…which renders as…
This template also works with ordered (a/k/a "numbered") lists as its content, for example:
{{Columns-list|colwidth=35em|
# {{Q|23}}
# {{Q|11806}}
# {{Q|11812}}
# {{Q|11813}}
# {{Q|11815}}
}}
The template, in fact, works with everything, since all it does is wrap the text provided around a block to be divided into columns by CSS. Do not stop at wikitext lists – more advanced lists generated by HTML-based templates will work too!
Error messages
[edit]Use of the now-unsupported parameter |cols=, or use of the first unnamed parameter (aka |1=) along with |2= or a second unnamed parameter for the template's content, will generate a red error message. To fix this error, use |colwidth= instead of attempting to explicitly specify the number of columns.
The presence of an equality symbol () within the template's content can also cause display problems and red error messages. To fix this, add =|1= in front of the template's content.
TemplateData
[edit]Columns-list
Formats a list to display split into columns. It is a wrapper for {{Div col}}, wrapping that template to allow for the content to be within the template call rather than sandwiched between a template above and below
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Content | 1 | Specifies the content to divide into columns | String | optional |
| Columns / Column width | colwidth | Specifies the width of columns, and determines dynamically the number of columns based on screen width; more columns will be shown on wider displays.
| String | optional |
| CSS style | style | Specifies any custom styling.
| String | optional |
| HTML class | class | Specifies any class or multiple space-delimited classes.
| String | optional |
See also
[edit]- {{Col-begin}}
- {{Div col}}
- {{Div col end}}
- {{Multicol}}
- {{Multicol-break}}
- {{Multicol-section}}
- {{Multicol-end}}
| The above documentation is transcluded from Template:Columns-list/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |