Module BaseDoc :: Class TableStyle
[frames] | no frames]

Class TableStyle

source code

Specifies the style or format of a table. The TableStyle contains the characteristics of table width (in percentage of the full width), the number of columns, and the width of each column as a percentage of the width of the table.

Instance Methods
 
__init__(self, obj=None)
Create a new TableStyle object, with the values initialized to empty, with allocating space for up to 100 columns.
source code
 
set_width(self, width)
Set the width of the table in terms of percent of the available width
source code
 
get_width(self)
Return the specified width as a percentage of the available space
source code
 
set_columns(self, columns)
Set the number of columns.
source code
 
get_columns(self)
Return the number of columns
source code
 
set_column_widths(self, clist)
Set the width of all the columns at once, taking the percentages from the passed list.
source code
 
set_column_width(self, index, width)
Set the width of a specified column to the specified width.
source code
 
get_column_width(self, index)
Return the column width of the specified column as a percentage of the entire table width.
source code
Method Details

__init__(self, obj=None)
(Constructor)

source code 

Create a new TableStyle object, with the values initialized to empty, with allocating space for up to 100 columns.

Parameters:
  • obj - if not None, then the object created gets is attributes from the passed object instead of being initialized to empty.

set_columns(self, columns)

source code 

Set the number of columns.

Parameters:
  • columns - number of columns that should be used.

set_column_width(self, index, width)

source code 

Set the width of a specified column to the specified width.

Parameters:
  • index - column being set (index starts at 0)
  • width - percentage of the table width assigned to the column

get_column_width(self, index)

source code 

Return the column width of the specified column as a percentage of the entire table width.

Parameters:
  • index - column to return (index starts at 0)