class table_view.TableColumn(object)

A TableColumn is used by a TableView to specify the title and formatting of one column of the table.

Constructor

TableColumn(title, width, align = 'l', fmt = None)
The title is a title string for the column to be displayed in the header, and width is the width of the column. Alignment is specified by align, which should be one of 'l', 'c' or 'r' for left, centre or right. If fmt is specified, it may be either a format string or a function of one argument taking a data item and returning a string.

Attributes

title
Title string for the column header.

width
Width of the column.

alignment
One of 'l', 'c' or 'r' for left, centre or right.

format_string
Format string for converting a data item to text.

formatter
A function of one argument taking a data item and returning a string. If supplied, this overrides format_string.

Default Methods

format(data)
Takes a data item and returns a string to be displayed. The default implementation uses the formatter function, if specified, otherwise the format_string.
---