Table Syntax


  • caption
  • th
  • colspan / rowspan
  • text alignment
    • indent
    • left (default)
    • center
    • right
  • thead / tfoot / tbody
  • colgroup / col
  • CSS: color, styles, width

resources

1. Syntax

Syntax Notes
Caption ?| Caption |? title of the table
Thead *| Header | Header |* head columns, entire row
Th ^| Header | Col ||
|| Col ^ Header ||
head row
Cellspan ||(colspan=2;rowspan=2) 2x2 | 1x1 || cell spanning, x colspan, y rowspan
Tfoot =| Footer | Footer |= not sure if this should be implemented at all

2. One


Table Caption

Table Caption

Cell spanning 2 columnsCell 3
Cell 4Cell 5Cell 6
Cell 7Cell 8Cell 9

Cell spanning 2 rowsCell 2Cell 3
Cell 5Cell 6
Cell 7Cell 8Cell 9

Fruit production in the last two years
ApplesPears
2005200620052006
Mary300Kg320Kg400kg280Kg
John400Kg630Kg210Kg300Kg

2x22x11x2
1x21x1
1x11x12x1

3. Two


Table Caption
1 2
a b

4. Three


1 2
a b

5. Four


Table Caption
Heading 1 Heading 2 Heading 3
Row 1 Col 1 Row 1 Col 2 Row 1 Col 3
Row 2 Col 1 some colspan
Row 3 Col 1 Row 3 Col 2 Row 3 Col 3

6. Five

Heading 1 Heading 2 Heading 3
Row 1 Col 1 Row 1 Col 2 Row 1 Col 3
Row 2 Col 1 some colspan
Row 3 Col 1 Row 3 Col 2 Row 3 Col 3

7. Six


Heading 1 Heading 2
Heading 3 Row 1 Col 2 Row 1 Col 3
Heading 4 no colspan this time
Heading 5 Row 2 Col 2 Row 2 Col 3

8. Seven

Table Caption
Heading 1 Heading 2 Heading 3
Row 1 Col 1 Row 1 Col 2 Row 1 Col 3
Row 2 Col 1 some colspan
Row 3 Col 1 Row 3 Col 2 Row 3 Col 3