Template:Table
Purpose
Template used to create a table in situations where doing so using regular Wikitext would break, such as inside of an instance of Template:Tabs. It replicates all functions of a table with minor alterations to the regular Wikitext formatting. For detailed information about tables in Wikitext, see Help:Tables on MediaWiki Wiki.
Usage
General
Normally, tables are written in Wikitext syntax using this general format:
{|class="wikitable" style=""
|Row1-Item1
|Row1-Item2
|-
|Row1-Item1
|Row2-Item2
}}
or
{|class="wikitable" style=""
|Row1-Item1 || Row1-Item2
|-
|Row2-Item1 || Row2-Item2
}}
These examples, which both produce the same output, begin with {| and end with |} at the start of a line. Due to the fact that the pipe character | is recognized as a parameter when embedded within another template, such as in Tabs, the regular markup cannot be used.
Instead, using this template, you can input:
{{Table|class-"wikitable" style-""
|Row1-Item1
|Row1-Item2
|-
|Row2-Item1
|Row2-Item2
}}
or
{{Table|class-"wikitable" style-""
|Row1-Item1 || Row1-Item2
|-
|Row2-Item1 || Row2-Item2
}}
with all four of the listed examples outputting the same table:
| Row1-Item1 | Row1-Item2 |
| Row2-Item1 | Row2-Item2 |
Differences from Regular Table Usage
This template has two major syntax differences from traditional Wikitext tables:
- When denoting table attributes, such as in the statement
class="wikitable", the=character must be changed to a-character; therefore, the prior statement should be changed toclass-"wikitable". In addition to this, the quotes around these statements are mandatory with this template. - Normally, the
!character at the start of a line denotes a header. So that it can be read as a parameter, this template requires that a regular|character be included before it; therefore, you would put|!at the start of a line to create a header.