If I understand what you want then
position:fixed should be used for the header.
If that is done, however the rest of the page may scroll, that element will remain fixed in its position. Something that would used, for example, labels for columns so as one scrolls the column header remains in place.
Note that you declare the CSS header class twice!
Once you have position:absolute and the other position:sticky
See
here [
^] for the difference between 'fixed' and 'sticky'