I have a table that needs a sticky header for vertical scroll. The table withotu scrolling looks like this:
Bu I have this problem when I scroll:
In the red square you can see that the body of the table are behind the header. If I put the border-top to 0 it solves the problem, but I need the table to have that border, I don't want to change the style.
The main css for the sticky header trick is this:
.tableFixHead {
overflow-y: auto;
height: 100px;
}
.tableFixHead thead th {
position: sticky;
top: 0;
}
.tableFixHead th {
background: white;
/*border-top: 0 !important;*/
}
.table-responsive-bold{
font-weight: bold;
}
I have this fiddle to test the problem: https://jsfiddle.net/pmiranda/eaLv7qpn/1/
I also had to put the background color of the th
elements in white. I took the idea from https://stackoverflow.com/a/47923622/3541320
Any suggestion?