Skip to content

Commit

Permalink
Remove invalid display properties on table, thead, tbody, and tfoot
Browse files Browse the repository at this point in the history
- `table` element needs to be `display: table` so that `table-layout: fixed`
works correctly.
- `thead`, `tbody` and `tfoot` need to use their default display properties,
otherwise columns become misaligned between header, body and footer. (#9779)
- Remove unecessary width on `thead`, `tbody`, and `tfoot` which is implicitly
100%
  • Loading branch information
talldan committed Sep 17, 2018
1 parent 61c5c69 commit 2fa1b81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
14 changes: 2 additions & 12 deletions packages/block-library/src/table/style.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
.wp-block-table {
thead,
tbody,
tfoot {
// Ensure container takes up same size as parent `table` element.
height: inherit;
}

// Fixed layout toggle.
&.has-fixed-layout thead,
&.has-fixed-layout tbody,
&.has-fixed-layout tfoot {
display: table;
// Fixed layout toggle
&.has-fixed-layout {
table-layout: fixed;
width: 100%;
}
Expand Down
13 changes: 2 additions & 11 deletions packages/block-library/src/table/theme.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
.wp-block-table {
overflow-x: auto;
display: block; // Necessary in order for this table to be mobile responsive.
border-collapse: collapse;
width: 100%;

thead,
tbody,
tfoot {
width: 100%;
min-width: $break-mobile / 2;
display: table;
}
min-width: $break-mobile / 2;
border-collapse: collapse;

td,
th {
Expand Down

0 comments on commit 2fa1b81

Please sign in to comment.