Styling Guide

Styling Guide#

Tablate styling is highly customizable.

A Tablate container instance may specify container styling.

Frame styling follows an order of inheritance. Global defaults can be set on the Tablate container instances. Each frame can specify frame, column and text styling. Additionally, where column dicts are used, column specific styling may be set.

Base styling applies to ASCII and HTML output, however base styling may be overwritten by HTML specific styling.

Inheritance follows the order of the least specific to most specific and HTML over base styling for HTML output.

Each style option has a default and where style options are not set, the default option will be used.

Simple base styling may be added as individual arguments. More advanced base styling and all HTML styling, however, requires styling dicts to be constructed and passed as arguments. For convenience, constructor classes are available from the root tablate module. Note: Only the style properties which wished to be set need be included. Other properties may be left blank.

import tablate as tb
from tablate import HtmlContainerStylesInput

tab = tb.Tablate(html_container_styles=HtmlContainerStylesInput(html_container_border_style="thin",
                                                                html_container_padding=20))

Please check the API Reference for more information.