I have a standard table which consists of a header row and n-data rows. The width of the table exceeds the size of the container in which it resides. I have styling on the header row (white background) which seems to truncate at the end of the viewable table. The overflow portion of the table does not seem to have the style applied. Is there something I am missing?
CSS
.grid-wrapper {
overflow-x: scroll;
text-align: center;
> .gt-header {
font-weight: bold;
background-color: white;
border-bottom: 1px solid black;
}
#training {
display: grid;
grid-template-columns: $grid-psta-training
}
#training-data > div {
display: grid;
grid-template-columns: $grid-psta-training;
text-align: center;
}
}
I used min-width: 100% with the hope that the styling would apply to the overflow area but with not luck. The area is left un-styled.
Codepen Example: https://codepen.io/dmytrie/pen/jOjGeXE
If you scroll you’ll notice the light green background-color is truncated which is undesirable.
Update 2:
After playing around with it further it seems that the issue stems from the grid-template-column sizes. If the number of columns and its widths exceed the size of the viewport then the styling is truncated if and only if the last template-column value is a non-fractional unit. Is there any properties we can use to ignore that. I’m open to using definite pixel sizes but that is really undesirable.
2
Answers
Initially, it appears there may be a structural issue with your HTML.