How can I freeze THEAD with CSS only?

I'm trying to freeze a section of THEADmy table so that when scrolling, it THEADalways displays. I accomplished this by attaching an event handler to an event scrollin jQuery that sets the topposition THEADto a scroll shift:

$(".scroll").scroll(function () {
    $("#header thead").css({"top": ($(".scroll").scrollTop()) + "px"});
});

You can see it in action on FIDDLE

+4
source share
1 answer

, , js ( css3). Jsfiddle duplicate , 1- , 2- . , , , . , , , .

0

Source: https://habr.com/ru/post/1524518/


All Articles