Help:Tables

This page explains how to create a table in an article. Tables use fairly complicated syntax in MediaWiki, but there are simple rules you can follow to make an effective and good-looking table.

The basics
To start a table, place the code  on a new line. The  defines a table, and the   styles it in the standard table style. To mark the end of a table, place  at the bottom.

Regular cells in the table start with the  (vertical bar) character. To add a cell, just start a line with this character and add the text you want to appear after it. Adding no extra text will make the cell empty. Cells will go from left to right in the order you add them.

To start a new row of the table, place  on its own line.

Here is an example of these basic table features.
 * }
 * }

Often, you want to make a cell a header cell. Header cells have a green background and bold text, and are commonly used on the top row and sometimes the left column of a table. To do this, replace the  with a.
 * }
 * }

To save space, instead of having each cell on its own line, you can use the vertical bar (or exclamation mark) character twice to start a new cell. This can make the wiki code harder to read, so only do this when there's a good reason to.
 * }
 * }

Make sure that every row and column has the same number of cells. If you add an extra column to one row, make sure to do that for all rows, or weird empty spaces will appear in the table. Similarly, if you add a new row, make sure it has a cell for every column.

More advanced features
Additional properties can be added to cells, rows, and entire tables to change their appearance or functionality.

Let's start with the  at the start. More words can be added after  to add more attributes to the table. Adding the text  allows each column to be sorted, which can be very useful, and additional attributes and options for each attribute are available. Here is an example of a sortable table.
 * }
 * }

It's also possible to add attributes to cells, by placing the property text after the vertical bar or exclamation mark, and then placing another vertical bar before the actual cell content. The most useful attributes are  and , which allow a cell to take up multiple columns or rows. The  attribute can be used to change a cell's appearance with CSS. A demonstration of how to use these attributes is below.
 * }
 * }

Those are all the most useful features of tables on Pikipedia, though not all features are covered – a lot is possible with a table. If you're having trouble with a table, consider looking around the wiki for other tables and seeing what they do, looking at the official MediaWiki table guide, or asking for help on the Discord server.