Kaya 0.5.2 reference for HTMLDocument::getTableCell

List of functions and data types in HTMLDocument

ElementTree getTableCell(ElementTree tsect, Int row, Int col)

Arguments

Usage

Retrieve a table cell so that content may be added to it. An Array::OutOfBounds Exception will be thrown if the row and column are not within the table.

table = addTable(parent,"Example table");
tbody = addTableBodySection(table);
for i in [0..2] {
    void(addTableRow(tbody));
}
addTableColumns(table,3);
for i in [0..2] {
    for j in [0..2] {
        td = getTableCell(tbody,i,j);
        addString(td,String(i+j));
    }
}
/*
Example table
+---+---+---+
| 0 | 1 | 2 |
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
| 2 | 3 | 4 |
+---+---+---+
*/

Naturally, the table in this simple example would be easier to generate using initialiseTable.

Related

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