SharePoint - Sticky Header

Here are two approaches:
Content Editor Webpart
1. First create a HTML file with the following content:
(adjust the path)
2. Upload this file to SharePoint
3. Add a content Editor Webpart to your page and edit the webpart

4. Put the path to the HTML file into the Content Link field:

5. Apply the changes, save the page
Script Editor Webpart
1. Add a Script Editor Webpart to your page
2. Edit the Webpart and click the EDIT SNIPPET button
3. Add the script tag (adjust the path), click Insert and save the page

And please don’t forget to add jQuery to your page.