
This page is a basic guide for creating tables using wiki markup.
Table
The table itself is defined by:
{| params |}
Instead of params, you can put any parameters you choose that would normally go into a HTML table. A common example used in many Memory Alpha tables is class="grey".
- Note: You must include the space between {| and params, or the first parameter gets ignored.
Caption
The caption is generated by:
|+ caption
The caption must go on its own line to be recognized by the wiki parser engine.
Row
A row of cells is started like this:
|- params
The code must be on its own line, and serves the same purpose as the <tr> tags.
Header
A header cell is created like this:
! heading
Each cell must go on its own line. This takes the place of the <th> tag. If you want to assign parameters to your cell, they will go like this:
! params | content
Make sure to have a space between the pipe and the parameters!
Cell
Normal table cells (<td>) are created like this:
| content
These are similar to header cells, except they use the pipe character instead of an exclamation point. Again, each cell must go on its own line. If you want to assign parameters to a cell, they go between two pipes:
| params | content
Example
The following example combines all of the previous examples:
{| class="grey" |+ Caption Here |- ! Header 1 ! Header 2 ! Header 3 |- | Row 1, Col 1 | Row 1, Col 2 | Row 1, Col 3 |- | Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 |- | colspan="2" | Row 3, Cols 1-2 | Row 3, Col 3 |}
And here is the table in its processed form:
Header 1 | Header 2 | Header 3 |
---|---|---|
Row 1, Col 1 | Row 1, Col 2 | Row 1, Col 3 |
Row 2, Col 1 | Row 2, Col 2 | Row 2, Col 3 |
Row 3, Cols 1-2 | Row 3, Col 3 |
See also
- MediaWiki Guide: Formatting Tables – provides more detailed instructions and advanced tricks for compressing the wiki format
- MediaWiki Guide: Collapsing Tables – provides more detailed instructions and advanced tricks for compressing the table format
Search • Namespaces • Page names • Shortcuts (keyboard) • Links (backlinks • piped • interwiki • redirects) • Categories • Supported browsers
New pages • Editing • Sections • Templates • Special characters • ISBN links • Edit summary • Minor edits • Edit conflicts
Wiki markup (HTML) • Tables (sorting) • Sections • Images (galleries) • Formulas • Poems and lyrics
Recent changes (enhanced) • Related changes • Watching pages • Diff • Page history • Edit summary • User contributions • Minor edits
Starting a new page • Renaming a page • Merging two pages • Protecting a page • Deleting a page • Edit conflicts