Help:Wikitable
Appearance
This redirect is being considered for deletion in accordance with Wikipedia's deletion policy.
Please discuss the matter at this page's entry on the Miscellany for deletion page. You are welcome to edit this page, but please do not blank, merge, or move it, or remove this notice, while the discussion is in progress. For more information, see the Guide to deletion. Maintenance use only: Place either {{mfd}} or {{mfdx|2nd}} on the page nominated for deletion. Then subst {{subst:mfd2|pg=Help:Wikitable|text=...}} ~~~~ to create the discussion subpage. Finally, subst {{subst:mfd3|pg=Help:Wikitable}} into the MfD log. Please consider notifying the author(s) by placing{{subst:MFDWarning|Help:Wikitable}} ~~~~ on their talk page(s). |
![]() | This help page is a how-to guide. It explains concepts or processes used by the Wikipedia community. It is not one of Wikipedia's policies or guidelines, and may reflect varying levels of consensus. |
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.

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.
- Cells and caption (
- 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 - Classes
class="wikitable sortable"
class="wikitable plainrowheaders"
Examples
A simple table
{| | A simple table |}
A simple table |
More complex examples
{| class="wikitable" style="text-align:center; width:80%;" |+ Table caption |- | ! scope="col" | Header col. A ! scope="col" | Header col. B ! scope="col" | Header col. C ! scope="col" | Header col. D |- ! scope="row" | Header row 1 |cell R1-A |cell R1-B |cell R1-C |cell R1-D |- ! scope="row" | Header row 2 |cell R2-A |cell R2-B |cell R2-C |cell R2-D |- ! scope="row" | Header row 3 |cell R3-A |cell R3-B |cell R3-C |cell R3-D |- ! scope="row" | Header row 4 |cell R4-A |cell R4-B |cell R4-C |cell R4-D |- ! scope="row" | Header row 5 |cell R4-A |cell R4-B |cell R4-C |cell R4-D |}
Header col. A | Header col. B | Header col. C | Header col. D | |
---|---|---|---|---|
Header row 1 | cell R1-A | cell R1-B | cell R1-C | cell R1-D |
Header row 2 | cell R2-A | cell R2-B | cell R2-C | cell R2-D |
Header row 3 | cell R3-A | cell R3-B | cell R3-C | cell R3-D |
Header row 4 | cell R4-A | cell R4-B | cell R4-C | cell R4-D |
Header row 5 | cell R4-A | cell R4-B | cell R4-C | cell R4-D |
{| border="1" style=" border-spacing: 5" |- ! scope="col" | Heading for column 1 ! scope="col" | Heading for column 2 ! scope="col" | Heading for column 3 |- |text for row 1, column 1 |text for row 1, column 2 |text for row 1, column 3 |- |text for row 2, column 1 |text for row 2, column 2 |text for row 2, column 3 |}
Heading for column 1 | Heading for column 2 | Heading for column 3 |
---|---|---|
text for row 1, column 1 | text for row 1, column 2 | text for row 1, column 3 |
text for row 2, column 1 | text for row 2, column 2 | text for row 2, column 3 |
{| border="1" style="border-spacing: 5; padding: 0" |- ! scope="col" | Heading for column 1 ! scope="col" | Heading for column 2 ! scope="col" | Heading for column 3 |- |text for row 1, column 1 |text for row 1, column 2 |text for row 1, column 3 |- |text for row 2, column 1 |text for row 2, column 2 |text for row 2, column 3 |}
Heading for column 1 | Heading for column 2 | Heading for column 3 |
---|---|---|
text for row 1, column 1 | text for row 1, column 2 | text for row 1, column 3 |
text for row 2, column 1 | text for row 2, column 2 | text for row 2, column 3 |
{| border="1" style="border-spacing: 5; padding: 0" |- ! scope="col" style="background:#efefef;" | Heading for column 1 ! scope="col" style="background:#efefef;" | Heading for column 2 ! scope="col" style="background:#efefef;" | Heading for column 3 |- |text for row 1, column 1 |text for row 1, column 2 |text for row 1, column 3 |- |text for row 2, column 1 |text for row 2, column 2 |text for row 2, column 3 |}
Heading for column 1 | Heading for column 2 | Heading for column 3 |
---|---|---|
text for row 1, column 1 | text for row 1, column 2 | text for row 1, column 3 |
text for row 2, column 1 | text for row 2, column 2 | text for row 2, column 3 |
{| border="1" style="border-spacing: 5; padding: 0" |- | ! scope="col" style="background:#efefef;" | Heading for column 1 ! scope="col" style="background:#efefef;" | Heading for column 2 ! scope="col" style="background:#efefef;" | Heading for column 3 |- ! scope="row" style="background:#efefef;" | Heading for row 1 |text for row 1, column 1 |text for row 1, column 2 |text for row 1, column 3 |- ! scope="row" style="background:#efefef;" | Heading for row 2 |text for row 2, column 1 |text for row 2, column 2 |text for row 2, column 3 |}
Heading for column 1 | Heading for column 2 | Heading for column 3 | |
---|---|---|---|
Heading for row 1 | text for row 1, column 1 | text for row 1, column 2 | text for row 1, column 3 |
Heading for row 2 | text for row 2, column 1 | text for row 2, column 2 | text for row 2, column 3 |