Tables in the wiki are one of the most effective and utilized ways for organizing the available content. Since they exploit wiki markup that cannot be seen anywhere but on a wiki, users are usually puzzled in the begining until they understand the principle. However, wiki markup was especially designed for people with few or no knowledge of HTML, CSS and web programming, so that be intuitive and easy.
Easiest way to get a table in your page is to click the table button in edit mode; you will obtain a table of three columns and two rows plus header, which you can further customize in accordance to your specific needs.
The standard source code (in edit mode) of a table is:
|
which in read mode looks like this:
|
{| class="wikitable"
|+ Table name
! column 1
! column 2
! column 3
|-
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
|-
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3
|}
|
Table name
column 1
|
column 2
|
column 3
|
row 1, cell 1
|
row 1, cell 2
|
row 1, cell 3
|
row 2, cell 1
|
row 2, cell 2
|
row 2, cell 3
|
|
A new row is added in this way:
|
yeilding the following output:
|
{| class="wikitable"
|+ Table name
! column 1
! column 2
! column 3
|-
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
|-
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3
|-
| row 3, cell 1
| row 3, cell 2
| row 3, cell 3
|}
|
Table name
column 1
|
column 2
|
column 3
|
row 1, cell 1
|
row 1, cell 2
|
row 1, cell 3
|
row 2, cell 1
|
row 2, cell 2
|
row 2, cell 3
|
row 3, cell 1
|
row 3, cell 2
|
row 3, cell 3
|
|
A new column is added in this way:
|
yielding the following output:
|
{| class="wikitable"
|+ Table name
! column 1
! column 2
! column 3
! column 4
|-
| row 1, cell 1
| row 1, cell 2
| row 1, cell 3
| row 1, cell 4
|-
| row 2, cell 1
| row 2, cell 2
| row 2, cell 3
| row 2, cell 4
|}
|
Table name
column 1
|
column 2
|
column 3
|
column 4
|
row 1, cell 1
|
row 1, cell 2
|
row 1, cell 3
|
row 1, cell 4
|
row 2, cell 1
|
row 2, cell 2
|
row 2, cell 3
|
row 2, cell 4
|
|
Tables can be sorted, with class="sortable"
.
{| class="sortable" style="border:1px solid;"
|+ Table name
! column 1
! column 2
! column 3
|-
| A
| 2
| A
|-
| C
| 3
| 1
|-
| B
| 1
| A
|}
|
Table name
column 1
|
column 2
|
column 3
|
A
|
2
|
A
|
C
|
3
|
1
|
B
|
1
|
A
|
|
See also