SharePoint: Hide List and Library Column Headings

I had a request for hiding the column headings of a list displayed in a web part. First thought was the toolbar, but they were asking about the clickable column headings. I think they were wanting to make a page look more like a regular web page instead a page full of lists. By the way this makes for a better way to display a view with only one column…

Note: This will of course remove the ability of the site visitor to sort and filter the web part.

Note: This will also work right in the view page (view pages use web parts!), but in SharePoint 2010 adding a web part to a view page will change how the ribbon gets displayed and will remove the View dropdown menu from the title area crumb trail.

Before (2007):

After (2007):

Before (2010):

After (2010):

Note: after this customization the checkbox column disappears, at least until you mouse over a document. Bug? I think it’s a bonus!

Steps:

Add your web part for the list to a page

For a minimal look set the toolbars to “none”

Below this web part add a Content Editor Web Part (CEWP)

Modify the CEWP and use the Source Editor button

Copy an paste the JavaScript below

If the CEWP displays it’s title bar then in the Appearance section set the Chrome to “none”

Or (preferred for SP 2010 other than view pages)

Copy the JavaScript to a Notepad file (name it something like “HideHeading.html”) and upload this file to a library

In the library where you uploaded this file, right-click this file and copy it’s shortcut / url

Below your web part add a Content Editor Web Part (CEWP)

Modify the CEWP and paste the URL copied above into the Content Link box

Save your changes

Or (for SharePoint view pages)

Edit the view page in SharePoint Designer

Copy and paste the Javascript to just before the end tag for PlaceHolderMain (just before </asp:Content>)

If you want to hide the column headings of multiple web part modify the IF statement like this Three web parts

Web part summary name!

In SharePoint 2007, the summary name is usually just the list’s name: “Shared Documents”.

In SharePoint 2010, the summary name is usually the list’s name PLUS the list’s description. For example the default for Shared Documents is: “Shared Documents Share a document with the team by adding it to this document library.” (including the period)

To find the correct name use your browser’s View Source option to display the HTML of the page and search for “summary=” and copy the text that follows.

<table summary="Shared Documents Share a document with the team by adding it to this document library."

Thanks for the post Mike, it worked great. Two key points for any folks having problems with the code:

1) as stated, the CEWP with the code must be placed after the list/library CEWP 2) the code must contain the underlying table name not the CEWP name in the case where you rename your list/library CEWP as I did ;)

The style ID approach is not selective and removes the heading from all similar web parts using the same ID (i.e. all document, form and wiki web parts). The JavaScript approach can be targeted to a single web part.

Both have an advantage depending on what's needed. (the more tools in the tool box the better)

Hi, this is exactly what I need to do, but you say Modify the CEWP and use the Source Editor button - I can't find the Source Editor button. I've gone into the Edit the Web Part section but still can't find it. I'm sorry to be stupid but I'm just not as familiar with this as I'd like to be. Btw, I'm using SharePoint 2010.ThanksK

This is Great , just one advise for the users who follow this , make sure you go to view source and get web part name from there , if you have a single space after the web part name it will show up there and code will not work if you will not add space in the code

I have found that this code works on my view (I am Site Collection Admin) but not on other's view (View Only access). The column headings appear on their page. Here is the code I am using per your post:

Great article, just what I've been looking for. I'm using SP2010 and have uploaded a html file with the code. Problem is I can't find "Content Link" you are referring to where the URL should go in CQWP.

Would appreciate if you could clarify in what section in CQWP the url to the html file should go.

Some of the content in a 2013 page is delay loaded, so View Source may not find all of the HTML. If using Internet Explorer, press F12 to display Developers Tools, then use its search features to find "source=".

Like others mentioned, make sure to account for any extra spaces in the Table Summary name.

However, I am running into problems with a grouped list on SP 2010 (expanded by default) where the first grouping collapses, while the others stay expanded. I want the whole list to be expanded. When I refresh the page, the list tries to expand, and then the first grouping collapses. Any suggestions? Thanks!