HtmlTable Module
- class epyk.core.html.tables.HtmlTable.Bespoke(page: PageModel, records, cols, rows, width, height, html_code, options, profile)
- add(row: Union[dict, list], missing: str = '', is_header: bool = False)
Add a row to the table.
Usage:
simple_table.row_add({"column": "value"})
- Parameters:
row – The row to be added to the table
missing – Optional. The data to put when a cell is missing
is_header – Optional
- Returns:
The python table
- col(header: Optional[Union[str, bool]] = None, i: Optional[int] = None)
Get the table column cells as a generator.
Usage:
for cell in t.col(i=1, header=False): cell
- Parameters:
header – Optional. Consider or not the header
i – Optional. The column index
- property dom: JsHtmlTable
Dom properties for a table.
- property header
Get the header row. Returns none if missing.
- property options: OptionsBasic
All table options.
- row(i: int, inc_header: bool = False)
Get the table rows.
Usage:
row = self.row(0)
- Parameters:
i – The column number.
inc_header – Optional. Default False
- set_editable_cols(col_indices: List[int])
Define columns as editable.
- Parameters:
col_indices – Column indices to be changed
- set_header(values: list, css: Optional[dict] = None)
Set the table header.
- Parameters:
values – A list of headers
css – Specific CSS attributes
- set_items()
Set the table definition.
- property tableId
Return the Javascript variable of the bespoke.
- class epyk.core.html.tables.HtmlTable.Cell(page: PageModel, text, is_header, options=None)
- property dom: JsHtmlRich
The cell Dom properties
- property options: OptionsTableCell
All table options.
- set_html_content(component: HtmlModel)
Set the cell content to be an HTML object.
- Parameters:
component – Python HTML object
- Returns:
self, the cell object to allow the chaining
- class epyk.core.html.tables.HtmlTable.Excel(page: PageModel, records, cols, rows, title, width, height, cell_width, delimiter, html_code)
- class epyk.core.html.tables.HtmlTable.Row(page: PageModel, cells, options: Optional[dict] = None)
- cell(i: int)
Get the cell value.
Usage:
row.cell(i=1)
- Parameters:
i – The cell index in the tr
- property dom: JsHtmlRich
The DOM attributes.
Usage:
row.dom
- property options: OptionsTableRow
All table options.