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
| Name | Type | Access | Description |
|---|---|---|---|
column_count | int | Read | How many columns the table has, from its widths or its widest row. |
rows | list[Row] | Read/Write | Gets or sets the rows. |
column_widths | list[float] | None | Read/Write | Gets or sets the column widths. |
columns | int | None | Read/Write | Gets or sets the columns. |
width | float | None | Read/Write | Gets or sets the width. |
padding | float | Read/Write | Gets or sets the padding. |
font_name | str | Read/Write | Gets or sets the font name. |
font_size | float | Read/Write | Gets or sets the font size. |
font | Any | Read/Write | Gets or sets the font. |
text_color | Any | Read/Write | Gets or sets the text color. |
alignment | str | Read/Write | Gets or sets the alignment. |
vertical_alignment | str | Read/Write | Gets or sets the vertical alignment. |
line_height | float | None | Read/Write | Gets or sets the line height. |
row_height | float | None | Read/Write | Gets or sets the row height. |
border_width | float | Read/Write | Gets or sets the border width. |
border_color | Any | Read/Write | Gets or sets the border color. |
background_color | Any | Read/Write | Gets or sets the background color. |
header_background_color | Any | Read/Write | Gets or sets the header background color. |
header_text_color | Any | Read/Write | Gets or sets the header text color. |
header_font_size | float | None | Read/Write | Gets or sets the header font size. |
repeat_header | bool | Read/Write | Gets or sets the repeat header. |
Methods
| Signature | Description |
|---|---|
__post_init__() | Calls post_init on this Table instance. |
add_row(cells: Any, header: bool) → Row | Append a row and return it. |
add_header_row(cells: Any) → Row | Append a row marked as a header – repeated when the table breaks. |
__len__() → int | Calls len on this Table instance. |
__iter__() | Calls iter on this Table instance. |
__getitem__(index: int) → Row | Calls getitem(index) on this Table instance. |
__repr__() → str | Calls repr on this Table instance. |