.io.formats.style.Styler.set_uuid ](pandas.io.formats.style.Styler.set_uuid.html)
    * [ pandas.io.formats.style.Styler.clear ](pandas.io.formats.style.Styler.clear.html)
    * [ pandas.io.formats.style.Styler.pipe ](pandas.io.formats.style.Styler.pipe.html)
    * [ pandas.io.formats.style.Styler.highlight_null ](pandas.io.formats.style.Styler.highlight_null.html)
    * [ pandas.io.formats.style.Styler.highlight_max ](pandas.io.formats.style.Styler.highlight_max.html)
    * [ pandas.io.formats.style.Styler.highlight_min ](pandas.io.formats.style.Styler.highlight_min.html)
    * [ pandas.io.formats.style.Styler.highlight_between ](pandas.io.formats.style.Styler.highlight_between.html)
    * [ pandas.io.formats.style.Styler.highlight_quantile ](pandas.io.formats.style.Styler.highlight_quantile.html)
    * [ pandas.io.formats.style.Styler.background_gradient ](pandas.io.formats.style.Styler.background_gradient.html)
    * [ pandas.io.formats.style.Styler.text_gradient ](pandas.io.formats.style.Styler.text_gradient.html)
    * [ pandas.io.formats.style.Styler.bar ](pandas.io.formats.style.Styler.bar.html)
    * [ pandas.io.formats.style.Styler.to_html ](pandas.io.formats.style.Styler.to_html.html)
    * [ pandas.io.formats.style.Styler.to_latex ](pandas.io.formats.style.Styler.to_latex.html)
    * [ pandas.io.formats.style.Styler.to_excel ](pandas.io.formats.style.Styler.to_excel.html)
    * [ pandas.io.formats.style.Styler.to_string ](pandas.io.formats.style.Styler.to_string.html)
    * [ pandas.io.formats.style.Styler.export ](pandas.io.formats.style.Styler.export.html)
    * [ pandas.io.formats.style.Styler.use ](pandas.io.formats.style.Styler.use.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ Style ](../style.html)
  * pandas.io.fo... 

#  pandas.io.formats.style.Styler.set_properties  #

Styler.  set_properties  (  _ subset  =  None  _ , _ **  kwargs  _ )  [
[source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/io/formats/style.py#L3015-L3045) #

    

Set defined CSS-properties to each ` <td> ` HTML element for the given subset.

Parameters  :

    

**subset** label, array-like, IndexSlice, optional

    

A valid 2d input to  DataFrame.loc[<subset>]  , or, in the case of a 1d input
or single key, to  DataFrame.loc[:, <subset>]  where the columns are
prioritised, to limit ` data  ` to _before_ applying the function.

****kwargs** dict

    

A dictionary of property, value pairs to be set for each cell.

Returns  :

    

Styler

    

Notes

This is a convenience methods which wraps the [ ` Styler.map()  `
](pandas.io.formats.style.Styler.map.html#pandas.io.formats.style.Styler.map
"pandas.io.formats.style.Styler.map") calling a function returning the CSS-
properties independently of the data.

Examples

    
    
    >>> df = pd.DataFrame(np.random.randn(10, 4))
    >>> df.style.set_properties(color="white", align="right")  
    >>> df.style.set_properties(**{'background-color': 'yellow'})  
    

See [ Table Visualization  ](../../user_guide/style.html) user guide for more
details.

[ __ previous  pandas.io.formats.style.Styler.set_sticky
](pandas.io.formats.style.Styler.set_sticky.html "previous page") [ next
pandas.io.formats.style.Styler.set_uuid  __
](pandas.io.formats.style.Styler.set_uuid.html "next page")

__ On this page

  * ` Styler.set_properties()  `

[ __ Show Source
](../../_sources/reference/api/pandas.io.formats.style.Styler.set_properties.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx Theme ](https://pydata-sphinx-
theme.readthedocs.io/en/stable/index.html) 0.14.4.