Multicol-section
Talk0this wiki
Template page
Usage
{{Multicol}} is used to start a multi-column section of a page. Between each block of column text insert {{Multicol-break}} and close the last column with {{Multicol-end}}. For example:
{{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}}
Provides this format:
This text appears in the first column. | This text appears in the second column. | This text appears in the third column. |
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 (1.5 em), creating a "gutter" that prevents text in one column from touching text in the column to its right.
Parameters
This template has two optional positional parameters: the overall width of the set of columns (default 100%), and the width of the gutter between columns (default 1.5em. There are also three optional keyword parameters: indent=3em increases the left margin by 3em. valign=bottom causes column text to be aligned at the bottom of the section rather than the top, which is the default. colspan=2<tt> causes this column to take two column-widths of space rather than 1.
For example, to create a multi-column section that is only 50% the width of the page, gutter 2em, and indented 4em:
{{Multicol|50%|2em|indent=4em}}
This text appears in the first column.
{{Multicol-break|2em}}
This text appears in the second column.
{{Multicol-break|2em}}
This text appears in the third column.
{{Multicol-end}}
Provides this format:
This text appears in the first column. | This text appears in the second column. | This text appears in the third column. |
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>DIV block that has the CSS attribute text-align set to either center or right, like this:
<div style="text-align:center;">
{{Multicol|50%}}
...
{{Multicol-end}}
</div>
To maintain the same column widths, and start a new section, beginning in column 1, use the {{Multicol-section}} template. This is useful for putting "headlines" over the columns, which may span multiple colums. Here's an example of this:
{{multicol||3em|indent=3em|valign=bottom|colspan=2}}
<center><big><big>Two-column headline</big></big></center><hr style="width:100%; height:2px; border:0px; background-color:black">
{{multicol-break|3em|colspan=3}}
<center><big><big>Three-column headline</big></big></center><hr style="width:100%; height:2px; border:0px; background-color:black">
{{multicol-break|colspan=1}}
<center><big><big>One-column headline</big></big></center><hr style="width:100%; height:2px; border:0px; background-color:black">
{{multicol-section}}
This is the text that goes in column 1.
{{multicol-break|3em}}
This is the text that goes in column 2, still under the first headline. I give it a double-wide (3em) gutter so that it separates from the columns for the next headline.
{{multicol-break}}
This is the text that goes in column 3, which is the first of three columns under the second headline.
{{multicol-break}}
This is the text that goes in column 4.
{{multicol-break|3em}}
This is the text that goes in column 5. Like column 2, I give it a double-wide gutter to separate it from the last headline.
{{multicol-break}}
This is the text that goes in column 6.
{{multicol-end}}
Provides this format:
This is the text that goes in column 1. | This is the text that goes in column 2, still under the first headline. I give it a double-wide (3em) gutter so that it separates from the columns for the next headline. | This is the text that goes in column 3, which is the first of three columns under the second headline. | This is the text that goes in column 4. | This is the text that goes in column 5. Like column 2, I give it a double-wide gutter to separate it from the last headline. | This is the text that goes in column 6. |
Usage notes
- Fixed width columns
- If you specify the total width in
{{multicol|<width>}}or let it default, then the columns will be fixed-width, which is most useful for text. If you specify a null width, using{{multicol|<width>}}, then the columns will be variable width, which is most useful for tables of information.