Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- document.getElementById("tablepress-10").addEventListener("scroll", function() {
- var translate = "translate(0," + this.scrollTop + "px)";
- this.querySelector("thead").style.transform = translate;
- });
- </script>
- table tbody, table thead
- {
- display: block;
- }
- table tbody
- {
- overflow: auto;
- height: 100px;
- }
- table {
- width: 350px; /* can be dynamic */
- }
- th
- {
- width: 75px;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement