HTML Styling

HTML Styling#

HTML styles are set using style dicts. For convenience, style dict constructors can be imported from the root tablate module. If not set, HTML styles are generated from base styles. HTML styles, where set, overwrite base styles.

HTML styling options mirror base styling options (with two exceptions: html_px_multiplier and html_default_styling). Some HTML style properties, however, include additional options over their base equivalents. For instance, while base divider styles are set with a single option ("thick", "thin", etc), HTML dividers have three options (style, weight, color).

Generally speaking, HTML style options are more flexible, allowing, for instance, any CSS color to be used for color properties.

Additionally, custom CSS styles may be added to a Tablate container instance using the ,apply_styles() method (see Common Methods (.apply(), .apply_style()) for more information).

html_px_multiplier argument

The html_px_multiplier argument is an integer multiplier which is applied to any HTML style using a pixel value (for instance: divider, text-size, padding).

html_default_styling argument

The html_default_styling argument sets some base default styles to the Tablate container instance beyond the usual styles. These additional styles seek to neutralize any existing page styles and then apply a background color to the container and style the rows to be more accessible.