Difference between revisions of "Template:Multicol"

From Shadow of the Throne Wiki
Jump to: navigation, search
m (moved Template:MultiCol to Template:Multicol: conforms to WP:MOSCL)
m (updated wikilinks)
Line 1: Line 1:
 
<includeonly><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"></includeonly><noinclude>
+
|<div style="margin-right:20px;"></includeonly><noinclude>
Use this template to start a multi-column section of a page. For example:
+
== 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>
 
<pre>
  {{MultiCol}}
+
  {{Multicol}}
 
  This text appears in the first column.
 
  This text appears in the first column.
  {{ColBreak}}
+
  {{Multicol-break}}
 
  This text appears in the second column.
 
  This text appears in the second column.
  {{ColBreak}}
+
  {{Multicol-break}}
 
  This text appears in the third column.
 
  This text appears in the third column.
  {{EndMultiCol}}
+
  {{Multicol-end}}
 
</pre>
 
</pre>
  
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 [[User:Franl|franl]]'s user page for examples of how this template can be used.
+
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. See [[User:Franl|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., <tt>12cm</tt>) or a percentage of the available page width (e.g., <tt>50%</tt>). This parameter defaults to <tt>100%</tt>. For example, to create a multi-column section of a page that is only 50% the width of the page, do this:
+
 
 +
== Parameters ==
 +
This template has one optional parameter: the overall width of the set of columns. This 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>. For example, to create a multi-column section that is only 50% the width of the page:
  
 
<pre>
 
<pre>
  {{MultiCol|50%}}
+
  {{Multicol|50%}}
 
  This text appears in the first column.
 
  This text appears in the first column.
  {{ColBreak}}
+
  {{Multicol-break}}
 
  This text appears in the second column.
 
  This text appears in the second column.
  {{ColBreak}}
+
  {{Multicol-break}}
 
  This text appears in the third column.
 
  This text appears in the third column.
  {{EndMultiCol}}
+
  {{Multicol-end}}
 
</pre>
 
</pre>
  
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 (HTML tag)|DIV]]</tt> block that has the [[Cascading Style Sheet|CSS]] attribute <tt>text-align</tt> set to either <tt>center</tt> or <tt>right</tt>, like this:
+
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 (HTML tag)|DIV]]</tt> block that has the [[Cascading Style Sheet|CSS]] attribute <tt>text-align</tt> set to either <tt>center</tt> or <tt>right</tt>, like this:
  
 
<pre>
 
<pre>
  <div style="text-align: center">
+
  <div style="text-align:center;">{{center|
  {{MultiCol|50%}}
+
  {{Multicol|50%}}
 
  ...
 
  ...
  {{EndMultiCol}}
+
  {{Multicol-end}}
  </div>
+
  }}</div>
 
</pre>
 
</pre>
  
==Related Templates==
+
== Related templates ==
 
+
The templates {{tl|Col-begin}} and friends do something similar to this template and its friends, but this template may be easier to use. Each of the following examples produce the same result (a 3-column table in which all columns have equal width):
The templates {{tl|Col-begin}} and friends do something similar to this template and its friends, but this template may be easier to use. Each of the following examples produce the same result (a 3-column table in which all columns have equal width):
+
  
 
<center>
 
<center>
{{MultiCol|50%}}
+
{{Multicol|50%}}
 
<pre>
 
<pre>
  {{MultiCol}}
+
  {{Multicol}}
 
  Column 1
 
  Column 1
  {{ColBreak}}
+
  {{Multicol-break}}
 
  Column 2
 
  Column 2
  {{ColBreak}}
+
  {{Multicol-break}}
 
  Column 3
 
  Column 3
  {{EndMultiCol}}
+
  {{Multicol-end}}
 
</pre>
 
</pre>
{{ColBreak}}
+
{{Multicol-break}}
 
<pre>
 
<pre>
 
  {{Col-begin}}
 
  {{Col-begin}}
Line 64: Line 66:
 
  {{Col-end}}
 
  {{Col-end}}
 
</pre>
 
</pre>
{{EndMultiCol}}
+
{{Multicol-end}}
 
</center>
 
</center>
  
It's simpler to add more columns to the {{tl|MultiCol}} example than to the {{tl|Col-begin}} example, because in the latter case, all occurrences of {{tl|Col-3}} would have to be changed to {{tl|Col-4}}.
+
It's simpler to add more columns to the {{tl|Multicol}} example than to the {{tl|Col-begin}} example, because in the latter case, all occurrences of {{tl|Col-3}} would need to be changed to {{tl|Col-4}}.
  
 
{{Template:Col-begin/doc}}
 
{{Template:Col-begin/doc}}
 
</noinclude>
 
</noinclude>

Revision as of 10:10, 20 November 2006

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}}

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. See franl's user page for examples of how this template can be used.

Parameters

This template has one optional parameter: the overall width of the set of columns. This can be an absolute value (e.g., 40em) or a percentage of the available page width (e.g., 50%). This parameter defaults to 100%. For example, to create a multi-column section that is only 50% the width of the page:

 {{Multicol|50%}}
 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}}

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;">{{center|
 {{Multicol|50%}}
 ...
 {{Multicol-end}}
 }}</div>

Related templates

The templates {{Col-begin}} and friends do something similar to this template and its friends, but this template may be easier to use. Each of the following examples produce the same result (a 3-column table in which all columns have equal width):

 {{Multicol}}
 Column 1
 {{Multicol-break}}
 Column 2
 {{Multicol-break}}
 Column 3
 {{Multicol-end}}
 {{Col-begin}}
 {{Col-3}}
 Column 1
 {{Col-3}}
 Column 2
 {{Col-3}}
 Column 3
 {{Col-end}}

It's simpler to add more columns to the {{Multicol}} example than to the {{Col-begin}} example, because in the latter case, all occurrences of {{Col-3}} would need to be changed to {{Col-4}}.

Template:Col-begin/doc