Difference between revisions of "Template:Columns/doc"
Jump to navigation
Jump to search
imported>Sardanaphalus (update) |
imported>Nnemo (Notably accessibility, details, air, link) |
||
| Line 1: | Line 1: | ||
{{Documentation subpage}} | {{Documentation subpage}} | ||
| − | <!-- EDIT TEMPLATE DOCUMENTATION | + | <!-- EDIT TEMPLATE DOCUMENTATION AFTER THIS LINE --> |
| − | Template <!--?: in the vein of navbox templates such as {{tl|Navbox}}--> to aid the creation of (up to ten) columns across a page. | + | |
| + | Template <!-- ?: in the vein of navbox templates such as {{tl|Navbox}} --> to aid the creation of (up to ten) columns across a page. | ||
== Syntax == | == Syntax == | ||
| + | |||
<pre> | <pre> | ||
{{columns | {{columns | ||
| − | |background = <!--Background colo(u)r (default none)--> | + | |background = <!-- Background colo(u)r (default none) --> |
| − | |style = <!--Use to add extra overall CSS styling--> | + | |style = <!-- Use to add extra overall CSS styling --> |
| − | |colwidth = <!--Width of each column (default 15.0em)--> | + | |colwidth = <!-- Width of each column (default 15.0em) --> |
| − | |gap = <!--Gap between each column (default 1.25em)--> | + | |gap = <!-- Gap between each column (default 1.25em) --> |
| − | |col1width = <!--Use to set a different width for col1--> | + | |col1width = <!-- Use to set a different width for col1 --> |
| − | |col1 = <!--First column's contents (mandatory)--> | + | |col1 = <!-- First column's contents (mandatory) --> |
| − | |col2width = <!--Use to set a different width for | + | |col2width = <!-- Use to set a different width for col2 (and so on) --> |
| − | |col2 = <!--Second column's contents (mandatory)--> | + | |col2 = <!-- Second column's contents (mandatory) --> |
|col3width = | |col3width = | ||
|col3 = | |col3 = | ||
| Line 22: | Line 24: | ||
</pre> | </pre> | ||
| − | The parameters ''<code>colstyle</code>'' and ''<code>col1style</code>'' to ''<code>col10style</code>'' may also be used to tailor all and/or individual columns' CSS styling. | + | The parameters ''<code>colstyle</code>'' and ''<code>col1style</code>'' to ''<code>col10style</code>'' may also be used to tailor all and/or individual columns' [[CSS]] styling. |
== Examples == | == Examples == | ||
| + | |||
; Code | ; Code | ||
<pre> | <pre> | ||
{{columns | {{columns | ||
| − | |col1 = Simplest<br/>application<br/>of | + | |col1 = Simplest <br/>application <br/>of |
| − | |col2 = this<br/>template | + | |col2 = this <br/>template |
}} | }} | ||
</pre> | </pre> | ||
| Line 35: | Line 38: | ||
; Result | ; Result | ||
{{columns | {{columns | ||
| − | |col1 = Simplest<br/>application<br/>of | + | |col1 = Simplest <br/>application <br/>of |
| − | |col2 = this<br/>template | + | |col2 = this <br/>template |
}} | }} | ||
| Line 52: | Line 55: | ||
|col2 = | |col2 = | ||
| − | The<br/>background<br/>is<br/>beige | + | The <br/>background <br/>is <br/>beige |
|col3 = | |col3 = | ||
; Each : column | ; Each : column | ||
| − | ; is : 8. | + | ; is : 8.5 [[Em (typography)|''em'']] |
; wide | ; wide | ||
| Line 69: | Line 72: | ||
{{!}} each {{!!}} is | {{!}} each {{!!}} is | ||
{{!-}} | {{!-}} | ||
| − | !colspan="2" align="center"{{!}} 3. | + | !colspan="2" align="center"{{!}} 3.25 ''em'' |
{{!}}} | {{!}}} | ||
}} | }} | ||
| Line 85: | Line 88: | ||
|col2 = | |col2 = | ||
| − | The<br/>background<br/>is<br/>beige | + | The <br/>background <br/>is <br/>beige |
|col3 = | |col3 = | ||
; Each : column | ; Each : column | ||
| − | ; is : 8. | + | ; is : 8.5 [[Em (typography)|''em'']] |
; wide | ; wide | ||
| Line 102: | Line 105: | ||
{{!}} each {{!!}} is | {{!}} each {{!!}} is | ||
{{!-}} | {{!-}} | ||
| − | !colspan="2" align="center"{{!}} 3. | + | !colspan="2" align="center"{{!}} 3.25 ''em'' |
{{!}}} | {{!}}} | ||
}} | }} | ||
| Line 110: | Line 113: | ||
<includeonly> | <includeonly> | ||
| − | <!--Categories--> | + | |
| + | <!-- Categories --> | ||
[[Category:Table and column templates]] | [[Category:Table and column templates]] | ||
| + | |||
</includeonly> | </includeonly> | ||
Revision as of 13:09, 29 May 2014
| This is a documentation subpage for Template:Columns. It contains usage information, categories and other content that is not part of the original template page. |
Template to aid the creation of (up to ten) columns across a page.
Syntax
{{columns
|background = <!-- Background colo(u)r (default none) -->
|style = <!-- Use to add extra overall CSS styling -->
|colwidth = <!-- Width of each column (default 15.0em) -->
|gap = <!-- Gap between each column (default 1.25em) -->
|col1width = <!-- Use to set a different width for col1 -->
|col1 = <!-- First column's contents (mandatory) -->
|col2width = <!-- Use to set a different width for col2 (and so on) -->
|col2 = <!-- Second column's contents (mandatory) -->
|col3width =
|col3 =
...
|col10width =
|col10 =
}}
The parameters colstyle and col1style to col10style may also be used to tailor all and/or individual columns' CSS styling.
Examples
- Code
{{columns
|col1 = Simplest <br/>application <br/>of
|col2 = this <br/>template
}}
- Result
|
Simplest application of |
this template |
- Code
{{columns |bgcol=beige |width=8.5em |gap=3.25em
|col1 =
* These
* columns
* are
* more
* complex
|col2 =
The <br/>background <br/>is <br/>beige
|col3 =
; Each : column
; is : 8.5 [[Em (typography)|''em'']]
; wide
|col4 =
{{{!}}
!colspan="2"{{!}} and
{{!-}}
{{!}} the {{!!}} gap
{{!-}}
{{!}}colspan="2"{{!}} between
{{!-}}
{{!}} each {{!!}} is
{{!-}}
!colspan="2" align="center"{{!}} 3.25 ''em''
{{!}}}
}}
- Result
|
The background is beige |
|
|
|||||||||||||
See also
Column-generating template families
| The templates listed here are not interchangeable. For example, using {{col-float}} with {{col-end}} instead of {{col-float-end}} would leave a HTML "div" (division) open, potentially harming any subsequent formatting. |
<section begin="table" />
| Family | Type | Handles wiki
table code? |
Responsive/ Mobile suited |
Start template | Column divider | End template |
|---|---|---|---|---|---|---|
| "Col" | Table | Yes | Yes | {{Col-begin}}, {{Col-begin-fixed}} or {{Col-begin-small}} |
{{Col-break}} or {{Col-2}} .. {{Col-5}} |
{{Col-end}} |
| "Col-float" | CSS float | Yes | Yes | {{Col-float}} | {{Col-float-break}} | {{Col-float-end}} |
| "Columns" | Table | No | Yes | {{Columns}} | – | – |
| "Columns-list" | CSS columns | Yes | Yes | {{Columns-list}} (wrapper) | – | – |
| "Columns-start" | CSS float | Yes | Yes | {{Columns-start}} | {{Column}} | {{Columns-end}} |
| "Flex columns" | CSS flexbox | Yes | Yes | {{Flex columns}} | – | – |
| "Div col" | CSS columns | Yes | Yes | {{Div col}} | – | {{Div col end}} |
I.e., can the columns handle the wiki markup {| | || |- |} used to create tables? If not, templates that produce these elements (such as {{(!}}, {{!}}, {{!!}}, {{!-}}, {{!)}}) or HTML tags (<table>...</table>, <tr>...</tr>, etc.) will need to be used instead.<section end="table" />