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:
- <style>
- TR.ms-viewheadertr > TH.ms-vh2 {
- DISPLAY: none
- }
- </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
Ben Customizations, Development, SharePoint 2010 Content Editor, SharePoint, SharePoint 2010
I was working with a client over the last few days on building a Project Workspace site template. We were nearly finished and had to make a couple last edits to a web part when we hit the JavaScript error. When expanding the details of the error it was similar to:
line: 2135
Char: 4
Error: ’style.display’ is null or not an object
code: 0
This error was keeping us from adding web parts and modifying current web parts (we could still delete web parts, but only by using http://url/default.aspx?contents=1 to get to our web part maintenance page).
I did some researching and thanks to this thread, I found this solution:
1) Place page in edit mode
2) Edit the content of the content editor web part by selecting the
‘modify web part’ drop down menu
3) Select the Rich Text Editor and copy the text if you do not want
to lose it.
4) Select Source Editor button, this opens the HTML source code for
the CE Web Part
5) Remove the source code. Our source code had a conflicting ID.
6) Update CE web part and make sure source code does not have auto
generated code, or just add a new content editor web part.
The thread varies on what web parts people had on the page, in our case, we only had one content editor web part and then several list web parts. Once we removed our single content editor web part, everything worked beautifully.
Ben SharePoint CEWP, Content Editor, Javascript, MOSS, SharePoint, Web Parts, WSS, WSSv3