The above css could cause a problem if there was more than one header row. Since top:0 is there it should only be applied to the 1st header row.
thead tr:first-child th {
position: -webkit-sticky;
position: sticky;
top: 0;
background-color: #2eA0ff;
}
Also need webkit for safari.
For multiple header rows you need nth child css or a little javascript where you sum the height of the previous rows.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Except it doesn't work well in table headers. I mean check this example:
charliepark.org/css-only-sticky-he...
It works for me only in Firefox Mobile. Not in desktop Chrome or Firefox.
Does it work for anybody?
It seems to work ok for me.
EDIT:
Just looked at the page you linked their elements table is wrong, they need to put
stickyon thethnot thethead.Adding this CSS would fix their problem.
The above css could cause a problem if there was more than one header row. Since top:0 is there it should only be applied to the 1st header row.
thead tr:first-child th {
position: -webkit-sticky;
position: sticky;
top: 0;
background-color: #2eA0ff;
}
Also need webkit for safari.
For multiple header rows you need nth child css or a little javascript where you sum the height of the previous rows.