I am trying to create a loading overlay on top of tbody (and only tbody). My current solution is to add tr as the last element of tbody and set
IMHO: In browsers which support CSS3 position:relative
on table elements should work.
As you have rightly revealed: it works only in Firefox. Not in IE, Edge and Chrome.
https://www.w3.org/TR/css-position-3/#valdef-position-relative
https://www.w3.org/TR/css-position-3/#property-index
Property name:
position
Applies to: all elements excepttable-column-group
andtable-column
https://developer.mozilla.org/en-US/docs/Web/CSS/position#relative About 'stacking context' but that is not the subject of this question
This value (
position: relative
) creates a new stacking context when the value of z-index is not auto. Its effect ontable-*-group
,table-row
,table-column
,table-cell
, andtable-caption
elements is undefined.