Help:Tables

There are special codes for creating tables, which could be useful for displaying something in columns and rows. While this might seem a little inconvenient at start, it only takes a little time to get used to. There are just a few basic codes required to create a table:


 *   &rarr; New table
 *   &rarr; Table caption (optional)
 *   &rarr; New row
 *   &rarr; New header cell
 *   &rarr; New normal cell
 *   &rarr; End table

Creating a simple table
The following guide explains how to create a simple table, which looks like the one below:

We will start with creating the beginning and the end of the table:

We'll now add the heading of the table. This is done using |+, followed by a space and then the heading:

We will now create the rows. This is done using the |- signs. Since we have 3 rows, we are going to use these signs 3 times:

Let's now create the first row of the table. As this is the heading row, we'll use the ! sign, to make a header cell, which appears bold: Notice how a double exclamation mark is used to separate different header cells that are on the same line. Cells on the same "row" don't have to be written on the same line though, more about that later.

Now we know how to create a table row, and we are going to add the contents to the next rows: Notice how only the first cell of each row has an exclamation sign. Normal cells which are indicated by pipe signs, may be mixed with header cells on the same row.

The table is almost complete. Now all we need is to add a border. This is done using "border=#" at the top of the table, similar to HTML. We'll also throw in some cellspacing and cellpadding for the finishing touch. The final result is the table above.

As an advanced alternative for styling your table, any style can be applied to a table, row or cell using the style attribute instead. This attribute takes common inline CSS style statements (CSS tutorial).

Cells on new line?
As mentioned earlier, cells or header cells could be written on new lines as well. This does change the code a bit, so the table example could also be created by the following code: If the cells get too long to fit on a line, this would be more convenient. Notice how the double exclamation sign or double pipe signs are now not required anymore.

Cell attributes
As with the tabel itself, cells can have attributes as well. This is done by putting the cell on it's own line, and then by specifying any attribute(s) before a single pipe sign before the content: Notice for both header cells and normal cells a pipe sign is used to separate attributes from content.

Comparing to HTML
If you are familiar with HTML tables, you'll probably find the following table useful:

Table parameters
There are a few parameters available for designing tables. Attributes of the entire table should be added in the first line of the table.