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

Fix table regressions. #9306

Merged
merged 4 commits into from
Aug 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/block-library/src/table/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.wp-block-table {
// Fixed layout toggle
&.has-fixed-layout tbody {
display: table;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be added as well for thead and tfoot?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should definitely be resolved.

table-layout: fixed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not used on the table element? This seems a bit odd.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason as noted in #9306 (comment) essentially.

}
}
1 change: 1 addition & 0 deletions packages/block-library/src/table/theme.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.wp-block-table {
overflow-x: auto;
display: block; // Necessary in order for this table to be mobile responsive.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems odd to me, changing display of a table element. I had some problem with this rule in a PR, so I took it out. What Exactly does mobile responsive mean here? Could you elaborate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To answer your question, if we had the whole thing wrapped in a div, we could do this instead:

https://codepen.io/joen/pen/RYojVZ?editors=1100

But as the markup is today, we need to leverage the table as the full-width block to hold the horizontal scrollbar, and then make a child element of that (in this case, tbody/thead/tfoot) be the full-wide table that has a min-width.

border-collapse: collapse;
width: 100%;

Expand Down