Closed
Description
Feature Type
-
Adding new functionality to pandas
-
Changing existing functionality in pandas
-
Removing existing functionality in pandas
Problem Description
Currently, the pandas Styler API can be used to create a HTML table from a dataframe. However, the tables it generates are not accessible: it fails WCAG/H63.
Feature Description
Ensure the output generated by Styler is accessible.
th
with classrow_heading
needs therow
scope
I use the current workaround to add this rule myself:
html_root = lxml.html.fromstring(frame_style.to_html())
for th in html_root.xpath("//th[contains(@class, 'row_heading')]"):
th.set("scope", "row")
Alternative Solutions
- Make the styler API more flexible for adding attributes. Currently, set_td_classes and set_table_styles aren't flexible enough for this, and set_table_attributes can't set attributes on
th
elements themselves.
Additional Context
No response
Metadata
Metadata
Assignees
Labels
Issue that has not been reviewed by a pandas team memberIssue that has not been reviewed by a pandas team member