Tables Module Demo

Tables module is a drupal filter module that I have developed.

The filter module takes a macro in the form:

[table=tables-grid 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. Therefore this macro becomes:

[table=tables-grid 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:

[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 ]

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

[table=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

[table=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

[table=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

[table=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

[table=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

[table=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

[table=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

[table=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

[table=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]

As of version 1.2 (uploaded on October 9, 2005) it now supports drupal themed tables this is done by setting the class to theme:

[table=theme 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]

Note that the theme'd tables do not support combining columns and rows at this time.