Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 3 tasks
reteps opened this issue Apr 24, 2025 · 1 comment
Closed
1 of 3 tasks

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

reteps opened this issue Apr 24, 2025 · 1 comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@reteps
Copy link

reteps commented Apr 24, 2025

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

@reteps
Copy link
Author

reteps commented Apr 24, 2025

@reteps reteps closed this as completed Apr 24, 2025
@reteps reteps changed the title ENH: ENH: th elements from Styler need the row scope Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

1 participant