Difference between revisions of "Template:Multicol"
(Added includeonly element around template code.) |
|||
Line 1: | Line 1: | ||
− | <div><!-- Do not remove this DIV: it prevents the Wiki code from inserting an extra linebreak above this table. --> | + | <includeonly><div><!-- Do not remove this DIV: it prevents the Wiki code from inserting an extra linebreak above this table. --> |
{| width="{{{1|100%}}}" border="0" cellspacing="0" cellpadding="0" style="background-color: transparent; table-layout: fixed" | {| width="{{{1|100%}}}" border="0" cellspacing="0" cellpadding="0" style="background-color: transparent; table-layout: fixed" | ||
|- valign="top" | |- valign="top" | ||
− | |<div style="margin-right: 20px"><noinclude> | + | |<div style="margin-right: 20px"></includeonly><noinclude> |
Use this template to start a multi-column section of a page. For example: | Use this template to start a multi-column section of a page. For example: | ||
Revision as of 16:49, 13 June 2006
Use this template to start a multi-column section of a page. For example:
{{MultiCol}} This text appears in the first column. {{ColBreak}} This text appears in the second column. {{ColBreak}} This text appears in the third column. {{EndMultiCol}}
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 (20 pixel) right margin, which prevents text in one column from touching text in the column to its right. See franl's user page for examples of how this template can be used. This template has one optional parameter: the overall width of the set of columns. This can be an absolute value (e.g., 12cm) or a percentage of the available page width (e.g., 50%). This parameter defaults to 100%. For example, to create a multi-column section of a page that is only 50% the width of the page, do this:
{{MultiCol|50%}} This text appears in the first column. {{ColBreak}} This text appears in the second column. {{ColBreak}} This text appears in the third column. {{EndMultiCol}}
The multi-column region is always positioned on the left side of the containing block. To change this, place the above Wikitext in a DIV block that has the CSS attribute text-align set to either center or right, like this:
<div style="text-align: center"> {{MultiCol|50%}} This text appears in the first column. {{ColBreak}} This text appears in the second column. {{ColBreak}} This text appears in the third column. {{EndMultiCol}} </div>