Back to Tools
Why make tables?
Tables are a very easy way of organising information.
Basic markup
All tables begin with {| and end with |}.
The most common markup used is known as the "pipe" - which looks like this |.
Building a basic table
The following code will build a basic table.
In the first line we set the widths of the borders and the space between cells.
{| border="1" cellpadding="1" cellspacing="1"
On the second line we enter the title of the table.
|+ 2006/07 Premier League Table
The following lines create the column headings, when creating the column headings we use a "!" instead of a pipe.
|-    
!Position 
!Club Name 
!Points 
Now we create the rows and the information that goes in them. Each line starts with a pipe and each row of information is seperated by a |-.
|- 
|1  ||  Manchester United  ||  89 
|- 
|2  ||  Chelsea  ||  83
|- 
|3  ||  Liverpool  ||  68
|-  
|4  ||  Arsenal  ||  68
|- 
 
|5  ||  Tottenham  ||  60
|- 
 
|6  ||  Bolton  ||  59
Notice that each cell is split by a double pipe ||. Usually there would be no space between the pipes, here the space is there to make reading the code easier.
This will create a basic table, which looks like this.
Useful extras
Table width:
In the first line of the table it is possible to define the table's width, for example:
{| width=1000pt border="1" cellpadding="1" cellspacing="1"
Column width:
To define the column width just add a percentage of the overall width to the column heading lines, as follows:
! width=25% | Position  
! width=50% | Club Name
! width=25% | Points
The table now looks like this:
| Position | Club Name | Points | 
|---|---|---|
| 1 | Manchester United | 89 | 
| 2 | Chelsea | 83 | 
| 3 | Liverpool | 68 | 
| 4 | Arsenal | 68 | 
| 5 | Tottenham | 60 | 
| 6 | Bolton | 59 | 
Common mistakes
One of the most common mistakes people make with tables is forgetting to put pipes in the code.
Also common is forgetting to finish the table with |}
See also
- For a complete guide to making tables see here