I am facing an issue with my data table requirement. I need to have 2 thead
elements in the table, both of which should stick when scrolling. However, only the last thead's tr
stays stuck at the top while the first one gets hidden.
Can anyone help me resolve this issue? The problem seems to be the mixing of top positions of both elements, and since their heights are dynamic, I am unsure how to fix it.
CSS :
.container{
border: 1px solid red;
height: 100px;
overflow-y: auto;
}
table{
width: 100%;;
border-collapse: collapse;
position: relative;
}
thead{
overflow-y: auto;
}
thead tr th{
background-color: yellow;
position: sticky;
left: 0; top: 0;
}
Thank you in advance for your assistance.