So we have a table with a max height and a sticky header. The max height is applied to a wrapper div and thead has position: sticky. The background color of this entire thing uses opacity to cheat the limited color palette with a softer color.
Now, I have two problems: first, I can't set the thead background to the semi-transparent color, because when the rest of the table scrolls beneath it, the content blends through. The second minor issue is (imo) that the scroll container includes the table header, so the scrollbar includes it as well, even though the header doesn't scoll with the rest of the table.
So I was thinking I should make the header fixed and only scroll the table body. Turns out you can't limit the height of tbody without setting display: block, which breaks the entire table layout. Grrr...
I could of course throw the table out and rebuild it with CSS Grid and whatnot, but I don't think that's a good approach. So I ended up accepting the too large scroll container. To fix the transparent header I used the ::before pseudo-element with a background color to block the table that scrolls beneath and to mix correctly with the semi-transparent actualy background color.
Works, but it's ugly and I still don't understand why tbody can't be a scroll container with max height.





