I'm trying to create a table that when the page goes down, the column row is fixed at the top.
So, in jQuery I defined in the scroll event that when the columns were below the offset, it changed the Position of the columns toFIXED
and POSITION TOP 0px
, and it works, it stays at the top and follows the scrolling.
The problem is that when scrolling the page, the TH
element changes size, it does not follow the rows of the table.
I tried to force the CLASS of the element TH
and TD
being the same, in order to get the size of the same place. Even so, when you scroll down the page, the element loses some pixels.
Within the class of TH
and TD
, I added
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
So that the padding
does not influence its size, nor did it work.
Does anyone know what it can be?