Click here to Skip to main content
13,558,765 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


Posted 20 Dec 2013
Licenced CPOL

SharePoint - Hiding Webpart div

, 20 Dec 2013
Rate this:
Please Sign up or sign in to vote.
How to hide the HTML tags that surround a web part (SuppressWebPartChrome)


When adding a DataFormWebPart web part in SharePoint, the following HTML is created by SharePoint when the page is rendered (or something similar to it).

<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" TOPLEVEL>
<TD vAlign=top>
<DIV id=WebPartWPQ2 allowDelete="false" 

OnlyForMePart="true" width="100%" HasPers="true" 

<!-- html rendered by web part -->
<IMG alt="" src="/_layouts/images/blank.gif" 

width=590 height=1> 


This code is tested in SharePoint 2007 with the DataFormWebPart.

Using the Code

In SharePoint Designer, add the SuppressWebPartChrome="True" property:

// Example

<WebPartPages:DataFormWebPart SuppressWebPartChrome="True"  

When this property is set, the outside Table and Div tags will not be rendered by SharePoint.

This has been specifically helpful for .css renderings where embedded Divs and Tables can get thrown off.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Jay Guiang
Architect GuiangStar Corp
Canada Canada
.in the MS development game for 14+ years.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180515.1 | Last Updated 20 Dec 2013
Article Copyright 2013 by Jay Guiang
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid