I have a gigantic list with many columns that I put on my sharepoint site using the import excel app. I would love to be able to make it so that the column headings still show when you scroll down. I've seen custom codes out there on the internet for this. I'm pretty new to sharepoint, so the process of how and where to add the code is confusing to me. I don't know what type of web part to use and how to correctly use it to attach the HTML or whatever is needed. If someone could explain the process and possibly point me towards a solution, that would be great.


You can try using Sticky Headers for SharePoint 2013. I would experiment with using it on just one page, list, or library to start with, and then if you like it, you can decide whether or not not to use it for your whole site. Below is how to do that.

Download Script Files

To use the Sticky Headers, first you need to download the StickyHeaders_v2.9BETA.js file from their downloads page. Then you'll also need to download jQuery. So the steps are to:

  1. Download StickyHeaders_v2.9BETA.js file.
  2. Download jquery.min.js file.

Add the Script Files to a List Page

  1. Upload the scripts to your SharePoint site. Click on the gear icon in the top-right corner and then Site Contents. Upload the scripts you just downloaded into a document library, such as Site Assets. You can upload them to an existing library or create a new library.
  2. Copy the location of the scripts you just upload to Notepad. Open up Notepad or another text editor (but not Word). Then go back to SharePoint and in the document library where you just uploaded the script files. In Internet Explorer, right-click on one of the file names and select Copy shortcut from the popup context menu. Paste this link in Notepad. Repeat the process for the other script file.
  3. Go the page that has the long list and put the page in Edit mode. Click on the gear icon in the top-right corner and then Edit page.
  4. Add a Script Editor Web Part to the page. In the Ribbon click the Insert tab then Web Part to open the Web Part panel. On the left column click the Media and Content category. In the middle column click Script Editor. (Here are some instructions for how to do this with screenshots)
  5. Add your script references to the Script Editor Web Part. In the web part, click Edit Snippet and then add the following script references (make sure to you put in the locations to your script files):

    <script type="text/javascript" src="http://yoursite/sites/yourlibrary/jquery.min.js"></script>
    <script type="text/javascript" src="http://yoursite/sites/yourlibrary/StickyHeaders_v2.9BETA.js"></script>

EDIT: Here's a source for referencing scripts -- see the section titled "Attribute Values" to see if that helps you understand how to reference your script files.

  1. Save the Script Editor Web Part and the page. On the web part, click Insert to save the script references. Then click the Save button in the right-hand corner on the page to save the page.
| improve this answer | |

This is a awesome script !!! It Works fine on SharePoint online !

Just added css style to make anchors visible.

<style type="text/css">
.ms-spGrid-HeaderContentStyle a {
    color: #000000 !important;

Thank you very much. You made my day !

| improve this answer | |

We can make sticky headers work in SharePoint online site which is with New experience setting.

  1. change list setting from New experience to default setting.
  2. click on edit page, add script editor webpart.
  3. click on Add snippet, Add below code:

    <script type="text/javascript" src="http://yoursite/sites/yourlibrary/jquery.min.js"></script>
    <script type="text/javascript" src="http://yoursite/sites/yourlibrary/StickyHeaders_v2.9BETA.js"></script>`
  4. click on stop editing, then you can observe that sticky headers work in 3 settings of a list: Default,New experience and classic.

Note: Make sure that you have added script files in given paths.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.