pandas.io.formats.style.Styler.set_table_attributes#

Styler.set_table_attributes(attributes)[源代码][源代码]#

设置添加到 <table> HTML 元素的表格属性。

这些是除了自动(默认)``id`` 属性之外的项目。

参数:
属性str
返回:
Styler

参见

Styler.set_table_styles

设置包含在 <style> HTML 元素中的表格样式。

Styler.set_td_classes

设置添加到 <td> HTML 元素的 class 属性的字符串 DataFrame。

例子

>>> df = pd.DataFrame(np.random.randn(10, 4))
>>> df.style.set_table_attributes('class="pure-table"')  
# ... <table class="pure-table"> ...