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

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

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

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

Parameters:
attributesstr
Returns:
Styler

参见

Styler.set_table_styles

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

Styler.set_td_classes

设置将为 <td> HTML 元素设置的 ‘class’ 属性的字符串 DataFrame。

Examples

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