Skip to content
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

Large table overflowing (hidden by right sidebar) without horizontal scrollbar #1824

Closed
jorisvandenbossche opened this issue May 21, 2024 · 1 comment · Fixed by #1827
Closed
Assignees

Comments

@jorisvandenbossche
Copy link
Member

Large tables can overflow, but without visual scrollbar to indicate this and help scrolling. This is noticeable in our own example from the kitchen sink (https://pydata-sphinx-theme.readthedocs.io/en/latest/examples/kitchen-sink/tables.html#giant-tables):

image

(it seems it is already like this in several releases, I noticed that in 0.9 it actually just didn't hide the overflow: https://pydata-sphinx-theme.readthedocs.io/en/v0.9.0/demo/kitchen-sink/lists-and-tables.html#giant-tables)

From quickly playing with the browser dev tools, I noticed that changing the display to frim table to block made it add a horizontal scrollbar:

// ensure table will fit in the article width and make them y-scrollable
table {
@include table-colors;
display: table;
overflow: auto;

@gabalafou
Copy link
Collaborator

gabalafou commented May 21, 2024

In some browsers, changing the display value of a table element to block, grid, or flex will alter its representation in the accessibility tree. This will cause the table to no longer be announced properly by screen reading technology.
MDN - display - Table

This issue with display: table and the accessibility tree may or may not be true anymore on newer browsers. But changing the display property has other consequences as well.

I think the most straightforward solution is to wrap each table in a scrollable div, which is what I do in #1827.

Carreau pushed a commit that referenced this issue May 22, 2024
ivanov pushed a commit to ivanov/pydata-sphinx-theme that referenced this issue Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants