# Tables

## Contents

- Simplified table creation
- Using the (:table:) wiki command

- Syntax
- Usage examples
- Nested tables

## Approaches to creating tables

There are two approaches to creating tables on wiki pages:

- using simplified wiki notation for creating small tables;
- using the (:table:)...(:tableend:) wiki command, which allows for finer tuning of the table appearance.

Both approaches are discussed below.

## Simplified table creation

To create tables using simplified wiki notation, use the following format:
|| parameters
|| First cell of the first row || Second cell of the first row || ... || Last cell of the first row ||
|| First cell of the second row || Second cell of the second row || ... || Last cell of the second row ||
...
When using this notation, you must declare the start of the table using the || symbols. These can be followed by optional table parameters, which are standard attributes of the HTML <table> tag (e.g., border, width, etc.). Each new line starting with || describes a row of the table. Table cells are also separated by ||. The same symbols are placed at the end of each table row.
Horizontal text alignment within table cells is set by spaces before and after the text inside the cell. This is shown in the following example:
Table code:
|| border=1 width=100%
||Left alignment || Center alignment || Right alignment||
Result:

Left alignment | Center alignment | Right alignment

## Using the (:table:) command

### Syntax

The wiki command (:table:) is more convenient for creating large tables with formatted text inside cells. The syntax for this command 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:)
The (:table:) wiki command can use the same parameters as the HTML <table> tag. The most commonly used parameters are:

- border to set the thickness of the table border. If border=0 (the default value), the table is displayed without a border.
- width to set the table width.
- align to set the table alignment.

The (:table parameters:)...(:tableend:) wiki command is converted into HTML code like: <table parameters>...</table>.
The (:row:) command indicates the start of a new table row; it is an analog of the HTML <tr> tag and can contain the same parameters.
The start of a new cell is defined using the (:cell:) command for regular cells or (:hcell:) for header cells. The (:cell:) command is an analog of the HTML <td> tag, and (:hcell:) is an analog of the <th> tag.

### Usage examples

Comment | Wiki notation | Result
--- | --- | ---
Table with a border and a header row | (:table border="1":) (:row:) (:hcell:)cell 1 (:hcell:)cell 2 (:hcell:)cell 3 (:row:) (:cell:)cell 4 (:cell:)cell 5 (:cell:)cell 6 (:tableend:) |
cell 1 | cell 2 | cell 3
--- | --- | ---
cell 4 | cell 5 | cell 6
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:) |
cell 1 | cell 2 | cell 3
cell 4 | cell 5 | cell 6
Using colspan and rowspan parameters to merge cells 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:) |
cell 1 | cell 2
cell 4 | cell 5

### Nested tables

To place one table inside a cell of another table, a single (:table:) wiki command is not enough. In such cases, the wiki parser would not know where the top-level table ends and the nested table begins. Therefore, to explicitly indicate the start and end of table creation, numbered commands were added: (:table1:), (:table2:), (:table3:), (:table4:), and (:table5:). These can be used in the same way as the (:table:) command but were created specifically for nested tables. According to the formatting rules for wiki commands, these numbered commands are closed using the expressions (:table1end:), (:table2end:), (:table3end:), (:table4end:), and (:table5end:) respectively.
Within a command like (:tableN:) (where N = 1, 2, ..., 5), numbered commands (:rowN:), (:cellN:), and (:hcellN:) must also be used to create rows and cells. This feature makes it clear which row or cell belongs to which table.
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 (:cell:)cell 3 (:row:) (:cell:)cell 4 (:cell:)cell 5 (:cell:)cell 6 (:tableend:) |
Table 2. Cell 1 | Table 2. Cell 2 | Table 2. Cell 3
Table 2. Cell 4 | Table 2. Cell 5 | Table 2. Cell 6
| cell 2 | cell 3
cell 4 | cell 5 | cell 6

The numbering of tables does not necessarily have to reflect the nesting level. For example, on this help page, the outer table for the last example is created using the (:table3:) command, while the nested ones use the (:table:) and (:table2:) commands.

See also:

- Text Formating
- Links
- Wiki commands