Template:Col: Difference between revisions

Template page
w:c:strategywiki>Prod
m (attempting again)
w:c:strategywiki>Prod
(Revert to revision 203481 dated 2007-10-23 01:43:46 by Prod using popups)
Line 1: Line 1:
<includeonly>{{#vardefine:colwidth|{{#switch:{{{1|}}}|2=49|3=33|4=24|5=19|{{#var:colwidth}}}}%">}}{{#switch:{{{1|}}}|5=<div style="float:width:{{#var:colwidth}}%">|4=<div style="float:width:{{#var:colwidth}}%">|3=<div style="float:width:{{#var:colwidth}}%">|2=<div style="float:width:{{#var:colwidth}}%">|end=</div>|</div><div style="float:width:{{#var:colwidth}}%">
<includeonly>{{#vardefine:colwidth|{{#switch:{{{1|}}}|2=49|3=33|4=24|5=19}}%}}{{#switch:{{{2|0}}}|begin=<div style="float:left;width:{{#var:colwidth}}">|end=</div>|0=</div><div style="float:left;width:{{#var:colwidth}}">}}</includeonly><noinclude>
}}</includeonly><noinclude>
{{Col/Documentation}}
{{Col/Documentation}}


[[Category:Templates]]</noinclude>
[[Category:Templates]]</noinclude>

Revision as of 03:22, 23 October 2007


This template is used to split content on pages up into columns, such as in a Table of Contents page.

Usage

{{col
|Number of columns - 2, 3, 4, 5, or 6
|begin, end, noclear (optional)
|Number of columns to span (optional)
}}

begin and end are only used at the beginning or ending of the set of columns (end will add a {{-}} after the closing div while noclear will not).

To have content span across multiple columns, use another field with the number of columns. This number must be no greater than the total number of columns, and should go after begin if being used on the first column.

Multiple {{col}} templates can also be nested inside of each other to split individual columns into more than one column. For example, The Legend of Zelda: A Link to the Past/Table of Contents.

Examples

{{#vardefine:colwidth|24%}}

Two columns
{{col|2|begin}}
column 1 text
{{col|2}}
column 2 text
{{col|2|end}}
{{#vardefine:colwidth|24%}}
Three columns. The middle one has two smaller ones.
{{col|3|begin}}
column 1 text
{{col|3}}
  {{col|2|begin}}
  column 3,1 text
  {{col|2}}
  column 3,2 text
  {{col|2|end}}
{{col|3}}
column 3 text
{{col|3|end}}
{{#vardefine:colwidth|24%}}
Four columns. The second one spans columns two and three.
{{col|4|begin}}
column 1 text
{{col|4|2}}
columns 2-3 text
{{col|4}}
column 4 text
{{col|4|end}}
{{#vardefine:colwidth|24%}}
Five columns. The first one spans columns one through three.
{{col|5|begin|3}}
column 1-3 text
{{col|5}}
column 4 text
{{col|5}}
column 5 text
{{col|5|end}}
{{#vardefine:colwidth|24%}}
Six columns
{{col|6|begin}}
column 1 text
{{col|6}}
column 2 text
{{col|6}}
column 3 text
{{col|6}}
column 4 text
{{col|6}}
column 5 text
{{col|6}}
column 6 text
{{col|6|end}}