For more extensive help with tables, see Help:Table.
For help with sorting the elements in tables, see Help:Sorting.
A table is an arrangement of columns and rows used to organize and position data. Tables are useful, and there are many ways and tricks that can be used.
The edit toolbar is shown above the editing window (Vector toolbar - default).Monobook toolbar
Adding a table
When editing pages a generic table can be added with the or (Insert a table) link in the edit toolbar. The following markup is inserted when "Insert a table" is clicked:
{| class="wikitable"
|-
! Header text !! Header text !! Header text
|-
| Example || Example || Example
|-
| Example || Example || Example
|-
| Example || Example || Example
|}
Markup
{|
table start
|+
table caption,optional; only between table start and first table row
|-
table row,optional on first row; wiki engine assumes the first row
!
table header cell, optional. Consecutive table header cells may be added on same line separated by double marks (!!) or start on new lines, each with its own single mark (!).
|
table data cell, required! Consecutive table data cells may be added on same line separated by double marks (||) or start on new lines, each with its own single mark (|).
|}
table end
The above markup must start on a new line except the double || and !! for optionally adding consecutive cells to a line. However, blank spaces at the beginning of a line are ignored.
HTML attributes: All table markup, except table end, optionally accepts one or more HTML attributes on the same line.
Cells and caption (| or ||, ! or !!, and |+) hold content. So separate any attributes from content with a single pipe (|). Cell content may follow on same line or on following lines.
Table and row markup ({| and |-) do not directly hold content. Do not add pipe (|) after their optional attributes. If a pipe is added improperly after attributes for the table or row markup, the parser will delete it and any final attribute that was touching the improper pipe.
Content may follow its cell mark on the same line after any optional HTML attributes or on lines below the cell mark. Content that uses wiki markup that itself needs to start on a new line, such as lists, headings, or nested tables, must be on its own new line.
Escaping to insert a pipe (|) character into a table use the <nowiki> markup