Skip Ribbon Commands
Skip to main content

Ben There, Done That

:

SharePoint Ben > Ben There, Done That > Posts > Hide Web Part Headers with SharePoint 2010
February 01
Hide Web Part Headers with SharePoint 2010

A while a go a write a short post on how to hide web part headers in SharePoint 2007.  Recently I had some inquire how to do the same thing for SharePoint 2010.  So, here is what to do in order to hide a web part header in SharePoint 2010.

1.  Add a content editor web part to your page.

2. Edit the Web Part

3. Click in the content area of the web part, click HTML and select “Edit HTML Source”

4. Put the following code in the web part:

  1. <style>
  2.   TR.ms-viewheadertr > TH.ms-vh2 {
  3.   DISPLAY: none
  4.   }
  5. </style>

 

5. Click “OK”

6. Expand “Appearance” (on the right side of the page)

7. Set the chrome type to “None”

8. Click “OK” and then save and check in your page.

The headers of your web part should now be hidden.  This can be extremely helpful when your page contains a web part using “boxed” for your style when creating a list view.  The only downside to this approach is if you have multiple web parts on a single page, it will hide the headers for all the web parts on your site.

How to do the same thing in SharePoint 2007

 

 Comments

 
 
 
 
 
 
 
 
 
 
 

Glad you liked it. Would you like to share?

Sharing this page …

Thanks! Close

Add New Comment

 

Showing 0 comments

    Trackback URL
     
    blog comments powered by Disqus
     

     Pre-Disqus Integration Comments

     

    Comments

    Hide Web Part Headers with SharePoint 2010

    @Raffaella  There could be a couple things.  This code worked for me as long as there wasn't a "Modified By" column, for some reason this code leaves that column in place.  So, you can also try replacing:

    "TR.ms-viewheadertr > TH.ms-vh2" with "TR.ms-viewheadertr".

    For me this took care of the "Modified By" column header but I haven't had the time to see what else it effected.  It seems like originally I didn't post that for some reason.  Right now it just escapes me as to what issue that may have caused.

    One other thing you mentioned the Content Editor web part modifying the HTML.  Occasionally this has caused a problem for me, another web part you could use instead is the HTML Form Web Part.  When you modify the source of that web part SharePoint won't try to automatically modify your code.
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    Hi and thanks for the tip.

    I tried but it doesn't work for me; possibly because the system automatically edits the HTML and changes the code?

    Apologies, I'm not a programmer, so I'm totally ignorant, but I was trying to solve precisely this layout problem on our Intranet.

    By the way, is it working for any kind of page in SP (besides Wikis)? For instance, Web part pages as well?
    Thanks for any suggestion you should have.
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    Thanks much. It worked great for me.
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    Thanks for the tip. I try to hide the checkbox as well but looks like the way to hide is no the same. Do you have some ideas about?

    thanks again!!!
    Hank
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    I have been very busy lately and haven't had time to look into an exact solution.  You should be able to do it by looking at the class of the list/library and modifying the CSS.  When I'm looking for this type of solution I'll use the IE Developer Toolbar or the FireFox developer toolbar as both have a tool to find elements in the page based on click and to view the CSS for those elements.  If I get a chance, I'll see if I can get a solution together for you, but hopefully this will point you in the right direction.
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    Can I change header background color for any view of list/ library?
    Please get-back me asap.
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    You can also do this without having to insert a web part (I needed this because I do want my headers and SPS 2010 Beta can't hide the content editor web part).
    In the wikipage just do the same thing like described in this blog. Good luck.
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM

    Hide Web Part Headers with SharePoint 2010

    [...] Hide Web Part Headers with SharePoint 2010 [...]
    Benjamin.SteginkNo presence information on 3/17/2011 12:03 PM