Skip Ribbon Commands
Skip to main content

Ben There, Done That

:

SharePoint Ben > Ben There, Done That > Posts > Hide column header in a SharePoint list web part
December 10
Hide column header in a SharePoint list web part
I was working on a site today and I added a list web part to the site.  I wanted the information to be displayed in two columns so I created a new view using “Boxed, no labels” as the style for the view.  The only problems was the column headers that end up at the top that really don’t make any sense or line up with anything. image To remove these annoying headers I used a simple content editor web part.  Instead of using the rich text editor, open up the Source editor and enter the following three lines: [css] <style> .ms-viewheadertr { display: none;} </style> [/css] Under Layout in the Content Editor Web Part check the “Hidden” check box so you’re web part wont’ be seen on your site and click OK.  The column headers will now be hidden from view. image This method can also be used to hide and/or change the look of other aspects of your SharePoint site without using SharePoint Designer or making any custom modifications.  Any change can easily be undone or changed by going into Page Edit mode and changing the source in the web part. How to do the same thing in SharePoint 2010
 

 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 column header in a SharePoint list web part

    uber cool! life would be so much easier with such Content Editor Webpart fixes.
    Benjamin.SteginkNo presence information on 3/21/2011 12:15 PM

    Hide column header in a SharePoint list web part

    This is awesome, thank you very much Ben & James!
    Benjamin.SteginkNo presence information on 3/21/2011 12:15 PM

    Hide column header in a SharePoint list web part

    Thanks.  It helps me.
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    Jeff,
         That is the one downside of the code in the actual post, however, there is a way around it.  If you look at the comment from James H, he describes the method for only applying this CSS to a single web part on your page.

    Thanks and let me know if you have any questions about it.

    ~Ben
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    Now that I've done that, how would I use the same method to turn the headers back on for a table that I want to appear below the one I turned the headers off on?  There's got to be another code to turn them back on right?
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    Thanks!  I would've never figured that one out.
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    Great solution - simple, quick, and best of all, it WORKS!
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    Thanks for the idea Ben, and special thanks to James for the enhancement.
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    @James H  
    Yes! I was just looking for this workaround. Tahnks a LOT! ; )
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM

    Hide column header in a SharePoint list web part

    I've been working with SP for two years. This was a total eureka moment. Mind blown. SO SIMPLE. Muchos gracias.
    Benjamin.SteginkNo presence information on 3/21/2011 12:16 PM
    1 - 10Next