Changes

Jump to navigation Jump to search
2,768 bytes added ,  14:03, 16 May 2013
Add template documentation
{{Documentation subpage}}
<!--
PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE
YOU CAN EDIT THE TEMPLATE DOCUMENTATION BELOW THIS COMMENT
-->
== Usage ==
{{tl|Multicol}} is used to start a multi-column section of a page. Between each block of column text insert <tt>{{tl|Multicol-break}}</tt> and close the last column with <tt>{{tl|Multicol-end}}</tt>. For example:

<pre>
{{Multicol}}
This text appears in the first column.
{{Multicol-break}}
This text appears in the second column.
{{Multicol-break}}
This text appears in the third column.
{{Multicol-end}}
</pre>

Provides this format:
{{Multicol}}
This text appears in the first column.
{{Multicol-break}}
This text appears in the second column.
{{Multicol-break}}
This text appears in the third column.
{{Multicol-end}}

You can have any number of columns. Each column will be the same width, equally dividing the available horizontal space. Each column has a small right margin (20 pixels), creating a "gutter" that prevents text in one column from touching text in the column to its right.

== Parameters ==
This template has two optional parameters: the overall width of the set of columns and the width of the gutter. The overall width of the set of columns can be an absolute value (e.g., <tt>40em</tt>) or a percentage of the available page width (e.g., <tt>50%</tt>). This parameter defaults to <tt>100%</tt>. The second parameter is the "gutter" for the whole column set, which defaults to 20px.

The {{tl|Multicol-break}} also takes an optional parameter for the gutter to its right, also defaulting to 20px.

For example, to create a 3-column section that is only 50% the width of the page, with 2-pixel right margins:

<pre>
{{Multicol|50%|2px}}
This text appears in the first column.
{{Multicol-break|2px}}
This text appears in the second column.
{{Multicol-break}2px}}
This text appears in the third column.
{{Multicol-end}}
</pre>

This results in:
{{Multicol|50%|2px}}
This text appears in the first column.
{{Multicol-break|2px}}
This text appears in the second column.
{{Multicol-break|2px}}
This text appears in the third column.
{{Multicol-end}}

The multi-column region is always positioned on the left side of the containing block. To change this, place the above Wikitext in a <tt>&lt;DIV&gt;</tt> block that has the CSS attribute <tt>text-align</tt> set to either <tt>center</tt> or <tt>right</tt>, like this:

<pre>
<div style="text-align:center;">{{center|
{{Multicol|50%|2px}}
...
{{Multicol-end}}
}}</div>
</pre>

=== See also ===
* {{tl|Multicol-break}}
* {{tl|Multicol-end}}

<includeonly>

<!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANKS. -->
[[Category:Table and column templates]]

<!-- PLEASE ADD INTERWIKIS BELOW THIS LINE, THANKS. -->
</includeonly>

Navigation menu