There are several ways to create table on wiki page: simple wiki notation and using (:table:)...(:tableend:) command. Simple method is designed for creation small and compact tables. (:table:) command allows to tune table appearance mode flexibly. Next will be described both methods.
To create table with simple wiki notation is used follow syntax:
|| Table params (<TABLE> tag attribute): border, width, etc
|| The first cell of the first row || The second cell of the first row || ... || The last cell of the first row ||
|| The first cell of the second row || The second cell of the second row || ... || The last cell of the last row ||
...
Horizontal align is given by spaces before and after text inside the cells. This is shown in follow example:
Table code:
|| border=1 width=100%
||Left align || Center align || Right align||
Result:
Left align | Center align | Right align |
Using the (:table:) command reminds table creation with HTML. Generalized using syntax is as follows:
(:table parameters:)
(:row parameters:)
(:hcell parameters:) Header cell text
(:hcell parameters:) Header cell text
...
(:row parameters:)
(:cell parameters:) Cell text
(:cell parameters:) Cell text
...
(:tableend:)
In the (:table:) command may used the same parameters as in <table> tag from HTML. Most used parameters are border to set table border width (if border="0" (default value) then table frame is not visible), width to set table width, and align to set table align.
In OutWiker (:table paraameters:)...(:tableend:) command will be converted to HTML code <table parameters>...</table>
The (:row:) command is specified to begin a new table row. This command is analog <tr> HTML tag and it may contain the same parameters.
The (:cell:) command is specified to begin a new cell, and (:cell:) is specified to begin a new heading cell. The (:cell:) command is analog <td> HTML tag, and (:hcell:) command is analog <th> HTML tag.
Comment | Wiki notation | Result |
||||||
---|---|---|---|---|---|---|---|---|
Table with a border | (:table border="1":) (:row:) (:hcell:)cell 1 (:hcell:)cell 2 (:hcell:)cell 3 (:row:) (:cell:)cell 4 (:cell:)cell 5 (:cell:)cell 6 (:tableend:) |
|
||||||
Table without a border | (:table:) (:row:) (:cell:)cell 1 (:cell:)cell 2 (:cell:)cell 3 (:row:) (:cell:)cell 4 (:cell:)cell 5 (:cell:)cell 6 (:tableend:) |
|
||||||
Using colspan and rowspan parameters to join cell horizontally and vertically |
(:table border="1" align="center":) (:row:) (:cell colspan=2 align=center:)cell 1 (:cell rowspan=2:)cell 2 (:row:) (:cell:)cell 4 (:cell:)cell 5 (:tableend:) |
|
Due to the nature of the wiki parser (part OutWiker program that convert wiki notation to HTML code) to a table be arranged in the cell the other table not enough single (:table:) command (In this case wiki parser will not know where ends the table top level, and where ends the nested table). Therefor for explicit indication to begin and end of the command it was created (:table:) commands with numbers, i.e. (:table1:), (:table2:), (:table3:), (:table4:) end (:table5:). They is used alike (:table:) command, but is designed for nested tables.
Note that these commands is closed with (:table1:), (:table2end:), (:table3end:), (:table4end:) and (:table5end:) expression respectively.
Inside (:tableN:) command must used numbered commands (:rowN:) and (:cellN:) / (:hcellN:) for creation table rows and cell respectively. This feature adds to the visibility of what the table which row or cell belongs.
For example:
Wiki notation | Result |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(:table border=1 align=center:) (:row:) (:cell:)(:table2 border=1:) (:row2:) (:cell2:)Table 2. Cell 1 (:cell2:)Table 2. Cell 2 (:cell2:)Table 2. Cell 3 (:row2:) (:cell2:)Table 2. Cell 4 (:cell2:)Table 2. Cell 5 (:cell2:)Table 2. Cell 6 (:table2end:) (:cell:)cell 2 (:row:) |
|
The numbering of the tables does not necessarily indicate the level of nesting. For example on this help page for decor the recent example outer table is created with (:table3:) command and nested tables - with (:table:) and (:table2:)