Table header to stay fixed at the top when user scrolls it out of view with jQuery

后端 未结 25 2559
悲&欢浪女
悲&欢浪女 2020-11-22 05:38

I am trying to design an HTML table where the header will stay at the top of the page when AND ONLY when the user scrolls it out of view. For example, the table may be 500

25条回答
  •  独厮守ぢ
    2020-11-22 06:23

    I have tried it using transformation:translate. While it works good in Firefox and Chrome, there is simply no function in IE11. No double scroll bars. Supports table tfoot and caption. Pure Javascript, no jQuery.

    http://jsfiddle.net/wbLqzrfb/42/

    thead.style.transform="translate(0,"+(dY-top-1)+"px)";
    

提交回复
热议问题