Tables Demo
Tables module is a Drupal filter module that I maintain the Drupal 5, 6 and 7 releases of.
It transforms the following macro code into rendered html tables:
[table=tables-grid summary="My table summary" Month |Jan | Feb | Mar | Apr
East| 7 | 14 | 21| 28
West | 7 | 14 | 21| 28
North| 7 | 14 | 21| 28
South | 7 | 14 | 21| 28]
The "[table" defines the beginning of the table. If a next character is a "=" it will then look for a string ending in a space to use as the table class. Only letters numbers and the "-" are permitted to be part of the class string Each cell is separated by a "|" and the rows are separated by a line feed. The optional summary operator will ensure your table meets w3c specifications. Therefore this macro becomes:
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
Multi column cells can be created by inserting only a "{" into a cell, and it will then be merged to the cell to the left of it, or if a "^" is inserted it will merge to the cell above. Therefore:
[table=tables-grid | Month |{ |{ |{
Direction |Jan | Feb | Mar | Apr
East| 7 | 14 | 21| 28
West | 7 | & | ^| 28
North| 7 | 14 | ^| 28
South | 7 | 14 | ^| 28]
Becomes:
| Month | ||||
| Direction | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | & | 28 | |
| North | 7 | 14 | 28 | |
| South | 7 | 14 | 28 | |
If the first character of the cell is a "!", then the cell will be a th cell (a header cell). This will allow you to construct even more specialized style sheets than what are included with this. To insert a literal "!" as the first character insert " !".
Included with the module is a number of predefined style sheets:
class: tables-elegant
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-professional
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-3d-effects-1
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-3d-effects-2
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-3d-effects-3
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-tables-simple
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-colorful
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-colorful-columns
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: tables-colorful-list
| Month | Jan | Feb | Mar | Apr |
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |
class: theme Drupal Themed: does not support combining columns and rows
| Month | Jan | Feb | Mar | Apr |
|---|---|---|---|---|
| East | 7 | 14 | 21 | 28 |
| West | 7 | 14 | 21 | 28 |
| North | 7 | 14 | 21 | 28 |
| South | 7 | 14 | 21 | 28 |





