This version is old school.
Please find jQuery plugins on npm.
jQuery THScroll
by Mathieu Bertholino
jQuery plugin for table header to have a fixed position to the page while your scroll down
jQuery plugin for table header to have a fixed position to the page while your scroll down