-
Styler.set_table_styles(table_styles)
[source] -
Set the table styles on a Styler. These are placed in a
<style>
tag before the generated HTML table.New in version 0.17.1.
Parameters: table_styles: list
Each individual table_style should be a dictionary with
selector
andprops
keys.selector
should be a CSS selector that the style will be applied to (automatically prefixed by the table?s UUID) andprops
should be a list of tuples with(attribute, value)
.Returns: self : Styler
Examples
12345>>> df
=
pd.DataFrame(np.random.randn(
10
,
4
))
>>> df.style.set_table_styles(
... [{
'selector'
:
'tr:hover'
,
...
'props'
: [(
'background-color'
,
'yellow'
)]}]
... )
Styler.set_table_styles()

2025-01-10 15:47:30
Please login to continue.