SharePoint 2010: Freeze Header Row of SharePoint List View

SharePoint 2010: Freeze Header Row of SharePoint List View

When a SharePoint list contains lots of data then it becomes hard to understand the data when you scroll down and header row is not visible , every time you have to scroll up to see what data in this particular cell is, you tend to check the column in the header. It will be easy to understand the data when your header row is visible all the time while you are scrolling down.

Here is a simple JQuery script which you can put in a content editor web part on the same list view page. It many not be required to make all list view header freeze so you can use this script only on the page where you want your list view header  to freeze

type="text/javascript"></script>
<style type="text/css">
<!--
.DataGridFixedHeader { ; top: expression(this.offsetParent.scrollTop);}
-->
</style>
   
<script type="text/javascript">
$(function(){
var $table = $("TABLE[ID^='{4C9CFF20-B467-4E10-820C-0A132442CF98}']:first",
"#MSO_ContentTable");
   
<!--WRAP TABLE IN SCROLL PANE-->
$table.wrap("<DIV style='OVERFLOW: auto; HEIGHT: 420px'></DIV>");
<!--FROZEN HEADER ROW-->
$("TR.ms-viewheadertr:first", $table).addClass("DataGridFixedHeader");
});
</script>


The above script uses a table as variable which is using the list GUID and the View ID so you have to update this portion of the script as per your list.

You can check the problem statement MSDN forum post at below link:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/a38f9798-7f49-4ca4-a6f2-f7272cfb7fe7/freeze-header-row-in-view

Other Languages

This article is also available in other languages:

Leave a Comment
  • Please add 4 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Benoit Jester edited Revision 4. Comment: Text, add french link

  • Maheshkumar S Tiwari edited Revision 3. Comment: Added Tag

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Maheshkumar S Tiwari edited Revision 3. Comment: Added Tag

  • Benoit Jester edited Revision 4. Comment: Text, add french link

Page 1 of 1 (2 items)