Constructor
new TableWriter(numberOfColumns, attr)
Creates a new TableWriter instance
Parameters:
Name | Type | Description |
---|---|---|
numberOfColumns |
Number | The number of columns in the table |
attr |
Object | An object containing attributes to use when rendering the single table elements. For a description see #table. |
- Source:
Returns:
An instance of TableWriter
Members
writeHeader :Boolean
If set to true the first row of the table data is rendered
using
<th>
tags (defaults to false).
Type:
- Boolean
- Source:
writeString :Boolean
If set to true the TableWriter returns the rendered table
as string, otherwise the table is written directly to response,
which is the default.
Type:
- Boolean
- Source:
Methods
close()
Closes all open table tags. If #writeString is set to
true, this method returns the rendered table.
- Source:
Returns:
The rendered table, if #writeString is set to
true, otherwise void.
write(text, attr)
Writes a single table cell to response.
Parameters:
Name | Type | Description |
---|---|---|
text |
String | The content of the table cess |
attr |
Object | An optional object containig attributes to render for this table cell |
- Source: