Advanced TablesLayoutWhere standard tables use the structure
[table]
[tr]
[td][/td]
[/tr]
[/table]
Advanced tables use
[table2]
[row]
[cell][/cell]
[/row]
[/table2]
Also supported are
[cellspan=WIDTH] and
[cellspan2=HEIGHT] in place of
[cell], which allow a cell to span multiple columns or rows respectively.
FormattingUsing
[row2] tags in place of
[row] tags will cause that row to be a different colour. Alternating between
[row] and
[row2] allows you to replicate book-style formatting. The post templates for classes and prestige classes (see the "Please choose..." box when posting) include tables with this formatting applied. You can also set colours manually, using
[row=COLOR] or
[cell=COLOR] - standard HTML colour rules apply, so
red and
#336699 are both valid formats.
You can pass styles to the table, using
[table2=STYLE] - the currently available styles are
- border (draws borders around every cell)
- orange (changes the default colours of [row] and [row2] to different shades of orange)
- rows (draws a horizontal line above each row)
- collapse (removes gaps between cells; used to improve the appearance of nested tables.)
Example tables (using alternating row/row2 tags)
A | B | C | D | A1 | B1 | C1 | D1 | AB2 | C2 | D2 | A3 | B3 | C3 | D3 | A4 | B4 | C4 | D4 |
| [table2] [row][cell]A[/cell][cell]B[/cell][cell]C[/cell][cell]D[/cell][/row] [row2][cell]A1[/cell][cell=red]B1[/cell][cell]C1[/cell][cell]D1[/cell][/row2] [row][cellspan=2]AB2[/cellspan][cell]C2[/cell][cell]D2[/cell][/row] [row2][cell]A3[/cell][cell]B3[/cell][cell]C3[/cell][cell]D3[/cell][/row2] [row][cell]A4[/cell][cell]B4[/cell][cell]C4[/cell][cell]D4[/cell][/row] [/table2] |
A | B | C | D | A1 | B1 | C1 | D1 | AB2 | C2 | D2 | A3 | B3 | C3 | D3 | A4 | B4 | C4 | D4 |
| [table2=border] [row][cell]A[/cell][cell]B[/cell][cell]C[/cell][cell]D[/cell][/row] [row2][cell]A1[/cell][cell=red]B1[/cell][cell]C1[/cell][cell]D1[/cell][/row2] [row][cellspan=2]AB2[/cellspan][cell]C2[/cell][cell]D2[/cell][/row] [row2][cell]A3[/cell][cell]B3[/cell][cell]C3[/cell][cell]D3[/cell][/row2] [row][cell]A4[/cell][cell]B4[/cell][cell]C4[/cell][cell]D4[/cell][/row] [/table2] |
A | B | C | D | A1 | B1 | C1 | D1 | AB2 | C2 | D2 | A3 | B3 | C3 | D3 | A4 | B4 | C4 | D4 |
| [table2=orange] [row][cell]A[/cell][cell]B[/cell][cell]C[/cell][cell]D[/cell][/row] [row2][cell]A1[/cell][cell=red]B1[/cell][cell]C1[/cell][cell]D1[/cell][/row2] [row][cellspan=2]AB2[/cellspan][cell]C2[/cell][cell]D2[/cell][/row] [row2][cell]A3[/cell][cell]B3[/cell][cell]C3[/cell][cell]D3[/cell][/row2] [row][cell]A4[/cell][cell]B4[/cell][cell]C4[/cell][cell]D4[/cell][/row] [/table2] |
A | B | C | D | A1 | B1 | C1 | D1 | AB2 | C2 | D2 | A3 | B3 | C3 | D3 | A4 | B4 | C4 | D4 |
| [table2=rows] [row][cell]A[/cell][cell]B[/cell][cell]C[/cell][cell]D[/cell][/row] [row2][cell]A1[/cell][cell=red]B1[/cell][cell]C1[/cell][cell]D1[/cell][/row2] [row][cellspan=2]AB2[/cellspan][cell]C2[/cell][cell]D2[/cell][/row] [row2][cell]A3[/cell][cell]B3[/cell][cell]C3[/cell][cell]D3[/cell][/row2] [row][cell]A4[/cell][cell]B4[/cell][cell]C4[/cell][cell]D4[/cell][/row] [/table2] |
SortingIf you use the
[tablesort] tag in place of
[table2], the headings of the table will become links; click on one to sort the entries by that column, and click again to reverse the order. This also
bolds the first row of the table automatically.
[tablesort] supports all the same styles as
[table2]; note that row colours remain with their rows as they're sorted, so trying to use alternating row colours doesn't work very well (as can been below).
Also note that because it's based on Javascript,
[tablesort] will not display properly in the Preview window, appearing as if you had used
[table2].
A | B | C | D | A1 | B1 | 4 | duck | A2 | B2 | 2 | pudding | A3 | B3 | 3 | emu | A4 | B4 | 1 | laugh |
| [tablesort] [row][cell]A[/cell][cell]B[/cell][cell]C[/cell][cell]D[/cell][/row] [row2][cell]A1[/cell][cell=red]B1[/cell][cell]4[/cell][cell]duck[/cell][/row2] [row][cell]A2[/cell][cell]B2[/cell][cell]2[/cell][cell]pudding[/cell][/row] [row2][cell]A3[/cell][cell]B3[/cell][cell]3[/cell][cell]emu[/cell][/row2] [row][cell]A4[/cell][cell]B4[/cell][cell]1[/cell][cell]laugh[/cell][/row] [/tablesort] |