pandas.io.formats.style.Styler.from_custom_template — pandas 3.0.0rc0+33.g1fd184de2a documentation (original) (raw)
classmethod Styler.from_custom_template(searchpath, html_table=None, html_style=None)[source]#
Factory function for creating a subclass of Styler.
Uses custom templates and Jinja environment.
Parameters:
searchpathstr or list
Path or paths of directories containing the templates.
html_tablestr
Name of your custom template to replace the html_table template.
html_stylestr
Name of your custom template to replace the html_style template.
Returns:
MyStylersubclass of Styler
Has the correct env, template_html, template_html_table andtemplate_html_style class attributes set.
See also
Export the styles applied to the current Styler.
Set the styles on the current Styler.
Examples
from pandas.io.formats.style import Styler EasyStyler = Styler.from_custom_template( ... "path/to/template", ... "template.tpl", ... ) df = pd.DataFrame({"A": [1, 2]}) EasyStyler(df)
Please see:Table Visualization for more examples.