Thursday, June 21, 2012

Apply borders to the XSLT Data View using SharePoint Designer

The Dataview webpart is customized by converting it to XSLT Data View.
To apply border for the XSLT Data View table using SharePoint Designer. 

In Designer, locate the table tag in the Web Part source view

<TABLE ID="{$List}-{$View}" Summary="{$List}" xmlns:o="urn:schemas-microsoft-com:office:office" o:WebQuerySourceHref="{$HttpPath}&amp;XMLDATA=1&amp;RowLimit=0&amp;View={$View}" width="100%" class="ms-listviewtable" border="0" 

Update the border="1" and also other changes based on your requirement, refer to the following post for more information about the table styles

http://www.htmlcodetutorial.com/tables/index_famsupp_147.html

If you applying the border for both rows and column, you'll see the border missing in the empty fields. You need to replace the empty fields with white-space.
"&nbsp;" will not work in XSLT, instead you can use &#160; 

No comments:

Post a Comment