Kaya 0.5.2 reference for HTMLDocument::InitialTableData

List of functions and data types in HTMLDocument

HTMLDocument::InitialTableData

Constructors

Usage

Initial table data. This allows quick initialisation of unformatted HTML tables. Required formatting can then be added using the usual methods by retrieving references to the individual table cells.

The table data consists of a header section (which may be empty), a footer section (which may be empty), and a list of body sections (of which at least one must exist). All sections have the same format - a list of rows each of which is a list of cells.

It is assumed that all rows have the same number of columns as the first row in the table, and cells overrunning this row length will be ignored.

header = [["Version","Date"]];
footer = [];
body = [[["0.2.1","2006-11-15"],["0.2.2","2006-11-26"],["0.2.3","2006-12-04"]]];
itd = InitialTableData(header,footer,body);

This will generate the following table

<table>
 <thead>
  <tr><th>Version</th><th>Date</th></tr>
 </thead>
 <tbody>
  <tr><td>0.2.1</td><td>2006-11-15</td></tr>
  <tr><td>0.2.2</td><td>2006-11-26</td></tr>
  <tr><td>0.2.3</td><td>2006-12-04</td></tr>
 </tbody>
</table>

Related

kaya@kayalang.org | Last modified 29 November 2011 | Supported by Durham CompSoc | Powered by Kaya