← Back to roadmap
DataFrame Styler
dataFrameStyle · highlightMax · backgroundGradient · barChart · toHtml · toLatex · mirrors pandas.DataFrame.style
Overview
The Styler class provides a fluent API for applying CSS styles to a
DataFrame and rendering the result as styled HTML — directly analogous to
pandas.DataFrame.style (the pandas.io.formats.style.Styler
class).
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
Import
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
Factory function
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.format(formatter, subset?, naRep?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.formatIndex(formatter)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.setPrecision(n)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.setNaRep(str)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.apply(fn, axis?, subset?)
Apply a column-wise (axis=0) or row-wise (axis=1) function.
The function receives an array of values and must return an array of CSS strings of the
same length.
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.applymap(fn, subset?) / .map(fn, subset?)
Apply an element-wise function (pandas ≥ 2.1 renamed applymap → map; both are supported).
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.setProperties(props, subset?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.highlightMax(options?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.highlightMin(options?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.highlightNull(color?, subset?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.highlightBetween(options?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.backgroundGradient(options?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.textGradient(options?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.barChart(options?)
Renders inline bar charts using CSS linear-gradient.
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.setCaption(text)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.setTableStyles(styles)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.setTableAttributes(attrs)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.hide(axis?, subset?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.toHtml(uuid?) / .render(uuid?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.toLatex(environment?, hrules?)
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.exportStyles()
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent
.clearStyles()
Click ▶ Run to execute
Ctrl+Enter to run · Tab to indent