Extension:TableData

TableData implements a. Additionally the row template can output the number of the current table row using  the value of this number starts at 1 for the first row.

For all templates, the header, footer, and row templates the names of the headers are included inside of  parameters where   is the first header,   is the second, and so on.

Note that because the names of headers are passed as arguments to the row template it becomes possible to hack in generic formatting templates (with a limited number of columns) by using a trick like  to output the contents of the first header and so on.

This template setup makes table data based tables very flexible. You can define fairly generic table formats to be used for data by using the  parameters to output header names, and the   trick to output table cells in header order. Or for more complex data you can define custom header, row, and footer templates with header names hardcoded in the templates and use the headers inside of the data table to define a clean set of parameters that the data should be exposed to the row templates with to make custom formatted data that previously took a lot of direct template inclusions much simpler.

Beta
There are one or two things not yet implemented in the extension.
 * A hook to allow extensions to define parsers for new input data formats.
 * The CSV parser needs some extra code to be compatible with php < 5.3 which does not have str_getcsv but has fgetcsv.

Alternatives

 * Extension:SimpleTable