Remove the header row from a SharePoint list.

Problem:
You’ve added a picture column to your SharePoint “Announcements” list and you now have an unwanted column header that shows up. You only want to remove the column header for specific lists. This method can be used to hide the column header on any individual list.

Solution:
Create a custom view style that doesn’t show the header row and can easily be applied to individual SharePoint list views.

As a best practice, make a copy of the “VWSTYLES.XML” file located in “C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATEGLOBALXML” on your SharePoint server before modifying it in the steps below. This will allow you to easily get back to where you started (without having to resort to restoring the file from tape).

Open the “VWSTYLES.XML” file and copy the first node starting at the beginning of <ViewStyle ID=”0″ and ending at the end of </ViewStyle>. Paste it at the end just inside the <ViewStyles> tag.

Change the <ViewStyle ID=”0″ to <ViewStyle ID=”21″ on the node you pasted or to a higher number if you have already used 21. Do not use a number less than 21 (they are the default ones). Change DisplayName=”$Resources:core,ViewStyleBasicTableName;” to DisplayName=”Basic, no header” and Description=”$Resources:core,ViewStyleBasicTableDesc;” to Description=”Basic, no header”. I used “Basic, no header” for the name and description, but anything meaningful will work.

Replace <HTML><![CDATA[“><TR class=”ms-viewheadertr” VALIGN=TOP>]]></HTML> with <HTML><![CDATA[“><TR class=”ms-viewheadertr” VALIGN=TOP style=”display: none;”>]]></HTML>. This will remove the list header as long as the list has at least one entry.

The following is needed to remove the header from a list with no entries. Replace <HTML><![CDATA[border=0><TR class=”ms-viewheadertr”>]]></HTML> with <HTML><![CDATA[border=0><TR class=”ms-viewheadertr” style=”display: none;”>]]></HTML>.

Run iisreset.exe. To apply the style you’ve just created, I recommend creating a new standard view for the list named “Frontpage” or something meaningful. Only show the picture and body. Sort on created, descending. This will show the newest items at the top and the oldest items at the bottom of the list. Set the style to “Basic, no header”:

Set the webpart to use the new list view you created. You now have a list without headers:

µ

1 Comment

  1. Jeff

    I found it still showed the headings with the option to sort them (ascending/descending). In the end I just removed the lines between

    ]]>

    and

    and that got rid of them completely

    Reply

Leave a Reply

%d bloggers like this: