Help:Tables

Coding tables in Wiki markup is relatively simple but the finished result can often appear confusing at a glance. You can practice tables in the sandbox without disturbing real articles.

Basics

 * The entire code for the table must be between two sets of a curly bracket ({ or }) and pipe (|).


 * To begin the code for a new row use a pipe and a dash on it's own line.


 * To put the code in each cell start a new line with a pipe and enter the cell's contents (can as simple as plain text or even empty). The next cell in the same row can either be started on a new line with a pipe or with a double pipe on the same line. These have the same effect and are user preferences.


 * A cell can be made a heading by replacing it's pipe (or pipes if using || to separate cells in a row).


 * You can add a caption to the table by adding a line beginning with a pipe and an addition sign. You can also define parameters, for example this border, after the first {|

This becomes:

Further syntax

 * For the creation of more complex borders and altering the text and background of a table the 'style=' parameter can be used. To make it affect the entire table it should be placed after the first {| but on the same line. To affect a row add it after the |- of the relevant row. To affect only a single cell it should be placed before that cell's code, separated by it by a pipe. Some of the more common terms used within style= are:
 * 'color:' Changes the color of the text. (the value after the colon should be a standard color name, ie color:red or color:white)
 * 'background:' Changes the background color. (the value after the colon should be a standard color name, ie background:blue or background:silver)
 * 'text-align:' Specifies where in each cell the text should be placed. (the value after the colon should be either left, right or center)
 * 'font-style:' Sets special characteristics of the font ie bold, italics.
 * 'font-size:' Sets the size of the font. (value ater the colon should be a percentage, ie font-size:110%)
 * 'border:' Defines the border. (values after colon should be width of border in pixels, a space, line style, a space, then border color. ie border:2px dashed blue)

When using more than one of the above in a 'style=' parameter definition each should be separated by a semi-colon and a space. Also, all clauses after the should be wrapped in speech marks, ie style="color:white; background:blue".

For example: