Remove Column Headers from Web Part

Posted: November 18, 2009 in Customization

Whenever you try to add a List view web by Edit Page -> Add New Webpart it will display the label without the column headers. But in case if you add the same webpart using a SharePoint designer it will display the webpart with the column headers.



In the above picture you can notice the title column name displayed. In some cases say you are putting this web part in your home page just to display the contents without any ttle or border. In such cases the column header has no meaning there hanging seperately.

So how we can remove or hide the column header. There are two ways.

First, Open the css file of the site and add this line .ms-viewheadertr{ display:none; }.

But this will be a global change and affect all the webparts.

Second, Create a content editor webpart in the page where your webpart lies and place the following code.

<style>
.ms-viewheadertr{ display:none; }
</style>

This will change only the web parts in the current page.

This is how your webpart will look like after adding the code.

Advertisements
Comments
  1. Lisajo says:

    Oh, my gosh. Thank you. It may be simple to you but is a goldmine to me!

  2. David says:

    In case anyone is doing this in Sharepoint 2010, use a HTML form web part instead of a content editor web part. Works a treat. Thanks!

  3. Jack says:

    Thanks, so what if i have Title, URL, Modified but i only want to hide URL.

  4. I know this if off topic but I’m looking into starting my own blog and
    was wondering what all is needed to get setup? I’m assuming having
    a blog like yours would cost a pretty penny?
    I’m not very web savvy so I’m not 100% sure. Any tips or advice
    would be greatly appreciated. Appreciate it

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s