|
class AbstractTable: |
|
|
def getAsCsv(self, colsep = ';'): |
|
Returns a string with the table in CSV (comma separated values)
format. Some information might be lost when exporting the table
to the CSV format. |
|
def getAsHtml(self): |
|
Returns a string with the table in HTML format. Some
information might be lost when exporting the table to HTML
format. |
|
def getAsLatex(self): |
|
Returns a string with the table in LaTeX format. |
|
def isLongtable(self, bool): |
|
Specifies if the latex package longtable should be used for
this table. |
|
|
[back to summary] |
|
class ColTable: |
|
|
def __init__(self, caption = None): |
|
Creates a new ColTable with an optional caption .
A ColTable is a table that is constructed by adding cols to the table,
i.e. the table is built col by col. |
|
def addCol(self, col, header = ''): |
|
Adds a new col to the table. header is the header of the col .
The first col of the table determines the length of all other cols.
If the new col is not the first col and its length is the same as the
the first col's length, a TableError is raised.
Exceptions:TableError, msg |
|
def addColSeparator(self, afterCol = -1): |
|
Adds a separator after col afterCol .
The first col has index 0.
If afterCol is negative, a separator is inserted after the most
recently added col. |
|
def addRowSeparator(self, afterRow): |
|
Adds a separator after row afterRow . The first row has index 0. |
|
def setColFormat(self, type, colNo = -1): |
|
Sets the (latex) format for column at index colNo (first col has
index 0). If colNo is negative, the format for the most
recently added col is set. The format only applies to cells
with numerical content. Use setColTextFormat for setting the
format of cells with textual content. |
|
def setColTextFormat(self, type, colNo = -1): |
|
Sets the (latex) format for column at index colNo (first col has
index 0). If colNo is negative, the format for the most
recently added col is set. The format only applies to cells
with textual content. Use setColTextFormat for setting the
format of cells with numerical content. |
|
|
[back to summary] |
|
class RowTable: |
|
|
def __init__(self, caption = None): |
|
Creates a new RowTable with an optional caption .
A RowTable is a table that is constructed by adding rows to the
table, i.e. the table is built row by row. |
|
def addColSeparator(self, afterCol): |
|
Adds a separator after col afterCol . The first col has index 0. |
|
def addRow(self, row): |
|
row is a list that contains the values for one row. If
there are too many values in the list (i.e. a row with
less cells than this has been added before) a exception is
raised. If there are not enough values the rest is filled with
the empty string.
A value can occupy several cells of a row. You can specify the
number of cells a value occupies by inserting the tuple
(colspan, value) into the row-list. colspan is the number
of cells value occupies.
Example:
addRow(['first', (2, 'hello world!'), 'fourth'])
inserts a row that is 4 cells wide into the table. The first
cell contains the value first , the second and third cell
together contain the value hello world! and the fourth cell
contains the value fourth .
|
|
def addRowSeparator(self, afterRow = -1): |
|
Adds a separator after row afterRow . The first row has index 0.
If afterRow is negative, a separator is inserted after the most
recently added row. |
|
def setColFormat(self, type, colNo = -1): |
|
Sets the (latex) format for column at index colNo (first col
has index 0). The format only applies to cells with numerical
content. Use setColTextFormat for setting the format of
cells with textual content. |
|
def setColTextFormat(self, type, colNo = -1): |
|
Sets the (latex) format for column at index colNo (first col
has index 0). The format only applies to cells with textual
content. Use setColTextFormat for setting the format of
cells with numerical content. |
|
def setLastHeaderRow(self, index = -1): |
|
Marks the 'index'-th row as the last header row. If index < 0 ,
the most recently added row is marked as the last header row
(in case no row has been added, an exception is raised). |
|
|
[back to summary] |
|
|