Set the uuid applied to id attributes of HTML elements.
Notes
Almost all HTML elements within the table, and including the <table> element are assigned id attributes. The format is T_uuid_<extra> where <extra> is typically a more specific identifier, such as row1_col2.
Examples
>>> df = pd.DataFrame([[1, 2], [3, 4]], index=['A', 'B'], columns=['c1', 'c2'])
You can get the id attributes with the following:
>>> print((df).style.to_html())
To add a title to column c1, its id is T_20a7d_level0_col0:
>>> df.style.set_uuid("T_20a7d_level0_col0")
... .set_caption("Test")
Please see: Table visualization for more examples.
© 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_uuid.html