Table

Overview

Table is a class in Aspose.PDF FOSS for Python.

A table of rows, ready to be placed on a page.

This class declares 7 methods for Table objects in Python programs. Available methods include: __getitem__, __iter__, __len__, __post_init__, __repr__, add_header_row, add_row. Public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package. Properties: alignment, background_color, border_color, border_width, column_count, column_widths, and 15 more.

Properties

NameTypeAccessDescription
column_countintReadHow many columns the table has, from its widths or its widest row.
rowslist[Row]Read/WriteGets or sets the rows.
column_widthslist[float] | NoneRead/WriteGets or sets the column widths.
columnsint | NoneRead/WriteGets or sets the columns.
widthfloat | NoneRead/WriteGets or sets the width.
paddingfloatRead/WriteGets or sets the padding.
font_namestrRead/WriteGets or sets the font name.
font_sizefloatRead/WriteGets or sets the font size.
fontAnyRead/WriteGets or sets the font.
text_colorAnyRead/WriteGets or sets the text color.
alignmentstrRead/WriteGets or sets the alignment.
vertical_alignmentstrRead/WriteGets or sets the vertical alignment.
line_heightfloat | NoneRead/WriteGets or sets the line height.
row_heightfloat | NoneRead/WriteGets or sets the row height.
border_widthfloatRead/WriteGets or sets the border width.
border_colorAnyRead/WriteGets or sets the border color.
background_colorAnyRead/WriteGets or sets the background color.
header_background_colorAnyRead/WriteGets or sets the header background color.
header_text_colorAnyRead/WriteGets or sets the header text color.
header_font_sizefloat | NoneRead/WriteGets or sets the header font size.
repeat_headerboolRead/WriteGets or sets the repeat header.

Methods

SignatureDescription
__post_init__()Calls post_init on this Table instance.
add_row(cells: Any, header: bool) → RowAppend a row and return it.
add_header_row(cells: Any) → RowAppend a row marked as a header – repeated when the table breaks.
__len__() → intCalls len on this Table instance.
__iter__()Calls iter on this Table instance.
__getitem__(index: int) → RowCalls getitem(index) on this Table instance.
__repr__() → strCalls repr on this Table instance.

See Also