微件:FixTableHeader
<style>
- fixed-table-header { background-color: white; }
</style><script> window.onscroll = function() {
var tables = document.getElementsByClassName("fix-table-header"); var hdr = document.getElementById('fixed-table-header'); for (var i = 0; i < tables.length; ++i) { var table = tables[i]; var rect = table.getBoundingClientRect(); if (rect.top < 0 && rect.bottom > 0) { if (hdr == null) { hdr = table.cloneNode(true); hdr.id = 'fixed-table-header'; hdr.style.position = 'fixed'; hdr.style.pointerEvents = 'none'; hdr.style.top = 0; hdr.style.width = table.style.width; table.parentNode.appendChild(hdr); hdr.style.visibility = 'hidden'; for (var i = 0; i < hdr.childNodes.length; i++) if (hdr.childNodes[i].tagName == 'THEAD') { hdr.childNodes[i].style.visibility = 'visible'; hdr.childNodes[i].style.pointerEvents = 'auto'; } } return; } } if (hdr != null) hdr.remove();
} </script>