Introduction
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>
<TBODY>
<TR>
<TD vAlign=top>
<DIV id=WebPartWPQ2 allowDelete="false"
OnlyForMePart="true" width="100%" HasPers="true"
WebPartID="00000000-0000-0000-0000-000000000000">
</DIV></TD></TR></TBODY></TABLE>
<IMG alt="" src="/_layouts/images/blank.gif"
width=590 height=1>
Background
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 Div
s and Table
s can get thrown off.