Set the table attributes added to the <table> HTML element.
These are items in addition to automatic (by default) id attribute.
See also
Styler.set_table_stylesSet the table styles included within the <style> HTML element.
Styler.set_td_classesSet the DataFrame of strings added to the class attribute of <td> HTML elements.
Examples
>>> df = pd.DataFrame(np.random.randn(10, 4))
>>> df.style.set_table_attributes('class="pure-table"')
# ... <table class="pure-table"> ...
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.io.formats.style.Styler.set_table_attributes.html