Skip to content

ENH: th elements from Styler need the row scope #61350

@reteps

Description

@reteps

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 class row_heading needs the row 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

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions