MozillaZine Knowledge Base:TablesFrom MozillaZine Knowledge Base
[edit] TableA table is defined by {| params
|}
which equals <table params> </table>
[edit] TDCells are generated either like this: |cell1 |cell2 |cell3 or like this: |cell1||cell2||cell3 which both equals <td>cell1</td><td>cell2</td><td>cell3</td> so "||" equals "newline"+"|" Parameters in cells can be used like this: |params|cell1 which will result in <td params> [edit] THFunctions the same way as TD, except "!" is used instead the opening "|". "!!" can be used instead of "||". Parameters still use "|", though! [edit] TR<tr> tags will be generated automatically for the first row. To start a new row, use |- which results in <tr> Parameters can be added like this: |- params which results in <tr params> Note:
[edit] CAPTIONA <caption> tag is created by |+ Caption which generates <caption>Caption</caption> You can also use parameters: |+ params|Caption which will generate <caption params>Caption
[edit] Examples[edit] Simple example {| generates
[edit] Advanced example{| align=right border=1 Note the floating table to the right.
[edit] Nested table
{| border=1
| blabla
|
{| bgcolor=#ABCDEF border=2
|nested
|-
|table
|}
|the original table again
|}
gives a nested table
[edit] Caption and multi-cell-lines
{| border=1 align=right
|+ '''This is the caption.''' Example taken from Afghanistan table.
|[[Independence]]||[[August 19]], [[1919]]
|-
|[[Currency]]||[[Afghani]]
|-
|[[Time zone]]||[[UTC]]+4:30
|-
|[[National anthem]]||[[Sououd-e-Melli]]
|-
|[[Top-level domain|Internet TLD]]||.AF
|}
is shown on the right.
[edit] Header test
made by
{| border=1
! Header1!! Header2
|-
| Cell1|| Cell2
|}
[edit] TR test
{|
| cell1 || cell2
|- bgcolor=#abcdef
| cell3 || cell4
|}
makes
[edit] Test for rows with mixed headers and body text
{| border=1 cellspacing=0
!
! col Header1
! ch2
|-
! row header 3
| abc def ghi
| gchf ghh dfgh
|-
! RH 4
| gfbb gbgbds
| dfgsdsdg
|}
makes:
but:
{| border=1 cellspacing=0
! !! col Header1 !! ch2
|-
! row header 3 || abc def ghi || gchf ghh dfgh
|-
! RH 4 || gfbb gbgbds || dfgsdsdg
|}
makes:
|
|