https://wiktenauer.com/index.php?title=Template:Column_templates&feed=atom&action=historyTemplate:Column templates - Revision history2024-03-28T12:43:53ZRevision history for this page on the wikiMediaWiki 1.34.2https://wiktenauer.com/index.php?title=Template:Column_templates&diff=17143&oldid=prevMichael Chidester: 1 revision2012-09-23T03:02:09Z<p>1 revision</p>
<p><b>New page</b></p><div>{{#switch:{{lc:{{PAGENAME}}}}<br />
| col-2 = The [[Template:Col-2]] sets column width for each of two columns, with align=left, valign=top. The width, align or valign can be changed: <nowiki>{{col-2 |width=40%|align=right|valign=center}}</nowiki>.<br><br><br />
| col-3 = The [[Template:Col-3]] sets column width for each of three columns, with align=left, valign=top. The width, align or valign can be changed: <nowiki>{{col-3 |width=25%|align=right|valign=center}}</nowiki>.<br><br><br />
| col-4 = The [[Template:Col-4]] sets column width for each of four columns.<br><br><br />
| col-5 = The [[Template:Col-5]] sets column width for each of five columns.<br><br><br />
| col-6 = The [[Template:Col-6]] sets column width for each of six columns, with align=left, valign=top. The width, align or valign can be changed: <nowiki>{{col-6 |width=20%|align=right|valign=center}}</nowiki>.<br><br><br />
| col-start=The [[Template:Col-start]] begins a wikitable (same as <nowiki>{{col-begin}}</nowiki>).<br><br><br />
}}<br />
The {{tl|col-begin}}, {{tl|col-break}} and {{tl|col-end}} templates control columns of text on a page:<br />
:*<nowiki>{{col-begin}}</nowiki>: starts a table (followed by <nowiki>{{col-break}}</nowiki> for 1st column)<br />
:*<nowiki>{{col-break}}</nowiki>: triggers the start of each column<br />
:*<nowiki>{{col-end}}</nowiki>: ends the multi-column table.<br />
The widths of columns can be specified by using various additional codes. See below for examples.<br />
<br />
== Usage ==<br />
:: <nowiki>{{col-begin|width=70%}}</nowiki>: start table with width.<br />
:: <nowiki>{{col-break|width=66%}}</nowiki>: start column-1 as 66% wide.<br />
:: This is text in col-1.<br />
:: <nowiki>{{col-break|width=33%}}</nowiki>: start column-2 as 33% wide.<br />
:: Text column-2.<br />
:: <nowiki>{{col-end}}</nowiki><br />
The table will have two columns, with column 1 twice (2×) the width of column 2.<br />
<br />
A border of 2px (1px width on each side) corresponds to a 5%. Therefore, with a 2px border—for example, as in [[Wikipedia:Tutorial (Wrap-up and more info)]]—the width needs to be 95% for the table to fit within the screen. Since it's possible that some tables might not have a border, correction on the individual page could be made after substitution. Another way to create a two column table is like this:<br />
<br />
{|<br />
|<br />
<pre><br />
{{col-begin|width=95%}}<br />
|-<br />
| <br />
Left column<br />
|<br />
Right column<br />
|}<br />
</pre><br />
|}<br />
<br />
{{col-begin}}<br />
{{col-1-of-4}}<br />
{{tl|Col-begin}}<br />
{{tl|Col-2}}<br />
Column 1 here<br />
{{tl|Col-2}}<br />
Column 2 here<br />
{{tl|Col-end}}<br />
{{col-2-of-4}}<br />
{{tl|Col-begin}}<br />
{{tl|Col-3}}<br />
Column 1 here<br />
{{tl|Col-3}}<br />
Column 2 here<br />
{{tl|Col-3}}<br />
Column 3 here<br />
{{tl|Col-end}}<br />
{{col-3-of-4}}<br />
{{tl|Col-begin}}<br />
{{tl|Col-4}}<br />
Column 1 here<br />
{{tl|Col-4}}<br />
Column 2 here<br />
{{tl|Col-4}}<br />
Column 3 here<br />
{{tl|Col-4}}<br />
Column 4 here<br />
{{tl|Col-end}}<br />
{{col-4-of-4}}<br />
and so on, up to {{tl|Col-5}}<br />
{{col-end}}<br />
<br />
{{col-begin}}<br />
{{col-1-of-4}}<br />
&#123;{[[Template:Col-begin|Col-begin]]|class=references-small}}<br />
{{tl|Col-break}}<br />
Column 1 here<br />
{{tl|Col-break}}<br />
Column 2 here<br />
{{tl|Col-break}}<br />
Column 3 here<br />
{{tl|Col-break}}<br />
Column 4 here<br />
{{tl|Col-break}}<br />
Column 5 here<br />
{{tl|Col-break}}<br />
Column 6 here<br />
{{tl|Col-end}}<br />
{{col-2-of-4}}<br />
{{tl|Top}}<br />
Column 1 here<br />
{{tl|Mid}}<br />
Column 2 here<br />
{{tl|Bottom}}<br />
{{col-3-of-4}}<br />
&#123;{[[Template:Columns-start|Columns-start]]|num=3}}<br />
Column 1 here<br />
{{tl|Column}}<br />
Column 2 here<br />
{{tl|Column}}<br />
Column 3 here<br />
{{tl|Columns-end}}<br />
{{col-4-of-4}}<br />
{{tl|Multicol}}<br />
Column 1 here<br />
{{tl|Multicol-break}}<br />
Column 2 here<br />
{{tl|Multicol-break}}<br />
Column 3 here<br />
{{tl|Multicol-break}}<br />
Column 4 here<br />
{{tl|Multicol-end}}<br />
{{col-end}}<br />
<br />
===Examples===<br />
: See: [[Template:Col-break/examples|Col-break/examples]].<br />
<br />
== See also ==<br />
{{column templates/others}}<br />
<br />
== External links ==<br />
* [http://www.htmlcodetutorial.com/_MULTICOL.html MULTICOL HTML tag]<br />
* [https://developer.mozilla.org/en/docs/CSS3_Columns CSS3 Columns], -moz-column-count<br />
<br />
<br />
{{Selfref|This [[Wikipedia:Template|template]] is a [[Wikipedia:Avoid self-references|self-reference]] and so is part of the Wikipedia project rather than the encyclopedic content.}}<br />
<br />
<noinclude><br />
[[Category:template documentation]]<br />
</noinclude></div>Michael Chidester