Help:Table

MediaWiki supports different types of table syntax:
 * 1) Limited HTML syntax
 * 2) Pipe syntax (which this article covers)

See the Wikipedia article on HTML elements for notes on traditional HTML. Note, however, that the,  ,  , and   elements are currently not supported in MediaWiki.

The pipe syntax substitutes pipes ( | ) for HTML. The pipes must start at the beginning of a new line, except when separating optional parameters from content or when using  to separate cells on a single line.

Example table
Would look like this:

Tables
Use  to open a table, and   closes a table. Parameters (such as align, style, etc.) can be assigned added after the opening brackets.

Please use  in Wowpedia tables to make them all purty-like:

Note how each column automatically adjusts to the width of its widest cell.

Captions
Captions are the name of the table, centered just above it, and are created by adding a line with  (plus desired parameters) just after the table-opening line. produces:

Rows
Rows are created with. Rows do not get closed; either start a new row or end the table.

Parameters added here will affect all cells in the row. for the 2nd row produces:

Cells
Cells can be entered in two formats. On separate lines, as in row 1 of our example table; or all on one line, as in row 2.

Parameters only affect their cell, and can be used in both formats: |param=" "|Cell1 |param=" "|Cell2 or |param=" "|Cell1||param=" "|Cell2

Like rows, cells are not closed; simply start a new row or close the table.

Cell Parameters (note that cell parameters will override any conflicting row parameters):
 * style: values can be "background-color: ", where is a word, such as gray or red.
 * width: values can be "px" where  is the number of pixels.
 * rowspan and colspan: values can be "" where  is the number of columns or rows to span. Most commonly used in headers, this allows a cell to span multiple rows or columns, starting in the current row or column.
 * bgcolor: values can be "#", where the variables are values 00 thru FF, hexadecimal values for the red (), green (), and blue () values of the desired color.

Example: !style="background-color:gray;" width="300px"|Header 1!!bgcolor="#FF0000" colspan="2"|Header 2

Headers
Headers are simply the top-most cells in a column, or the left-most cells in a row. They describe the contents of that column or row. They use  instead of the   used for regular cells, but parameters still use "|".

Like normal cells, headers can be listed on separate lines (as in our example table), or all on one line: !Header 1!!Header 2!!Header 3

Sorting
Columns on a table are made sortable by adding a class at the table opening:

Vic The Reputation column uses hidden, non-displaying numbers to determine sort order: # Non-displaying letters can also be used to sort a list by surname if desired. For long lists, you should include at least the first few letters for sub-sorting names that start with the same letter. Aze Bill Azeroth

Striped tables
In long tables, or in tables with multi-line rows, it may be desirable to visually distinguish rows. This is accomplished by making every other row use a different background with  at the start:

This also works for sortable tables. The zebra tag ensures that the rows have alternating colors, even when the order of the rows is changed by sorting.

You can also manually control the striping by using  at the beginning of the desired rows:

Rows with this tag will have the alternative color. This method is only advisable for non-sortable tables.