Open oluckyman opened 2 years ago
We could fix this by adding a z-index: 1;
here:
Thank you for the quick response!
I am curious is it a known browser bug? Don't understand why normal content renders just fine and the semi-transparent content appears above 🤔
@oluckyman Here’s a result I found on stacking contexts if you want to learn about this behavior: https://www.oreilly.com/library/view/developing-web-components/9781491905685/ch04.html
Thanks Mike, it was helpful! 🙌
If someone curious too, this peace was missing in my mental model:
A stacking context is created when an element is positioned and assigned a z-index value other than auto, or when an element has an opacity value less than 1
So by setting opacity
to the cell of the table I made it compete with the stacking context of the header, which has position: sticky
.
Knowing this I fixed the glitch by setting position: relative; z-index: -1
to my custom HTML in table cells.
Added the workaround to the notebook:
When I use custom format with HTML that have
opacity
, the cell content appears above the table header. See example notebook:It's not a big deal for prototyping and exploring. But I love
Inptuts.table
and am using it a lot, including for presenting to users custom tables like this