5.6. Creating Heading, Footing and Group Rows


5.6.1. Overview

The table filter now supports the following attributes:


5.6.2. Heading Rows

If the headings attribute is not defined, then the column headings are generated using the column names given on the parsing line. For example, the column headings in the table below will be Name and Age:

!block table
Name    Age
Bill    42
!endblock

Alternatively, if the headings attribute is defined, then that number of data rows are used as the column headings, i.e. the parsing line is not used to build the column headings. For example, the column headings in the table below will be "Title" and Age (remembering that a filter attribute is implicitly given the value 1 is no value is supplied).

!block table; headings
A       B
"Title" Age
Bill    42
Sally   23
!endblock

Likewise, the column headings below will be Preferred Title and Likely Age with each heading taking 2 rows.

!block table; headings=2
A           B
Preferred   Likely
Title       Age
Bill        42
Sally       23
!endblock

5.6.3. Footing Rows

These work exactly the same as table headings, except that no footings are generated by default.


5.6.4. Group Rows

If the groups parameter is specified, SDF assumes that rows that end in : are group rows. For example:

!block table; groups
Fruit      Comments
Tropical:
mango      a fruit-bat favorite
banana     great for smoothies
Other:
Tomato     often matched with basil
!endblock

The result is:

Fruit Comments
Tropical:  
mango a fruit-bat favorite
banana great for smoothies
Other:  
Tomato often matched with basil