There is a way in css to specify relative to which scroll context a position sticky element should be floating?
<div class="main">
<div class="row">
<div class="cell">(0, 0)</div> <!-- I want this to be sticky -->
<div class="cell">(0, 1)</div>
<div class="cell">(0, 2)</div>
...
<div class="subtable">
<div class="somtehing">
<div class="row">
<div class="cell">(0, 0)</div> <!-- I also want this one to be sticky to the .main tag -->
<div class="cell">(0, 1)</div>
<div class="cell">(0, 2)</div>
...
The first column of the nested table rows, despite of how many tags deep is inside the DOM tree always uses the .main div as it’s scroll context because is its the first one that it found going up in the tree.
// this makes the subtables less annoying enforcing a scroll
// but makes the sticky to be relative to .subtable
.subtable
height: 100px
overflow-y: auto
check this other codepen example
If I enforce a height and a scroll-y auto to the .subtable div, then the stickyness of the cells in the subtable are applied to this scroll context since is the first one they found in their way up.
I would like to ignore that first one scroll context and tell to the sticky columns to be aware of the second scroll context in their way up of the tree. Or maybe to specify directly to which tag is supoused to listen.