Template:Columns-start
Lua error in Module:TNT at line 167: Missing Commons dataset I18n/Module:TNT.tab.
The {{Columns-start}}
template and its sibling templates {{Column}}
and {{Columns-end}}
can be used to make a fixed number of columns (up to five) that will span the width of the page above a certain minimum width, (100 em for five columns, 80 for four, 60 for two or three). Below the minimum width, each column starting from the right will gracefully wrap to appear beneath another one of the columns.
Usage
The examples below are using the templates directly, so you can see what will happen if the minimum size is reached.
{{Columns-start}} Column 1 here {{Column}} Column 2 here {{Columns-end}}
{{Columns-start|num=3}} Column 1 here {{Column}} Column 2 here {{Column}} Column 3 here {{Columns-end}}
{{Columns-start|num=4}} Column 1 here {{Column}} Column 2 here {{Column}} Column 3 here {{Column}} Column 4 here {{Columns-end}}
{{Columns-start|num=5}} Column 1 here {{Column}} Column 2 here {{Column}} Column 3 here {{Column}} Column 4 here {{Column}} Column 5 here {{Columns-end}}
Parameters
{{Columns-start}}
accepts these parameters:
|num=
- Set the number of columns. Defaults to 2. The template will work with up to 5 columns. More than that should prefer a custom implementation or another solution (such as a wikitable for tabular content or {{div col}} for list content).
|class=
- Apply another class to the set of columns, such as
hlist
. Default is none. |bgcolor=
- Set a background color. Default is transparent.
|width=
- Set a total width in which all columns must appear. Default is 100%.
{{Column}}
has the same parameters where it is used as a "wrapper" template with numbered columns. For example:
{{Column|num=2|1= Column 1 here |2= Column 2 here }}
{{Column|num=3| Column 1 here | Column 2 here | Column 3 here }}
In the second example, be aware of the possible problem with a column that includes an equals sign. See wikipedia:Help:Templates#Equals for more information.
Otherwise, {{Column}}
must be used as above with {{Columns-start}}
.
Example
This is an example from List of Indonesia-related topics on English Wikipedia:
Palaces in Indonesia
Prisons
Shopping malls
Towers
Limitations
Using headings inside {{Column}}
in its wrapper form functions so long as there is some content beneath the second (and any subsequent) heading(s). Secondly, headings will not carry an edit link. The table below may wrap (i.e. not display as columns) but displays the issue.
Content | Functional but missing edit links | Non-functional (missing content) |
---|---|---|
Wikitext | {{Column|1= ==== Example heading 1 ==== ABC |2= ==== Example heading 2 ==== DEF }} |
{{Column|1= ==== Example heading 3 ==== |2= ==== Example heading 4 ==== }} |
Rendered | Example heading 1ABC Example heading 2DEF |
Example heading 3
==== Example heading 4 ==== |