Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Guys i need to position 2 data view web part controls next to each other in a body column of a web part page.

I've customised the xslt to output as an unordered list which are wrapped in div's which are floated next to each other, but this doesn't work. I've checked the html output and it seems the output from the webpart is in a table cell. How can i go about achieving this?

This is the html

<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%"><TBODY>
<TR>
<TD id=MSOZoneCell_WebPartWPQ6 class=s4-wpcell-plain vAlign=top>
<TABLE style="WIDTH: 655px" class=s4-wpTopTable border=0 cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top>
<DIV style="WIDTH: 655px; OVERFLOW: auto" id=WebPartWPQ6 class=noindex allowDelete="false" HasPers="false" WebPartID="b26580e9-dfdc-4e0c-bc08-628d332c3106">
<DIV class=Ramboll_PageDescriptionWrapper xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:ddwrt2="urn:frontpage:internal" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<H2 class=Ramboll_PageTitle>Digital Design Panel</H2>
<DIV class=ExternalClass5A1C745674054218800A6055F4816685>
<P>​Our Role is to lead technical excellence, innovation, and best practice and continous improvement in our use of Digital Design. We have two supporting Panels, one leading best practice in BIM, the other leading our approach to analysis</P></DIV></DIV></DIV></TD></TR></TBODY></TABLE>
<DIV class=ms-PartSpacingVertical></DIV></TD></TR>
<TR>
<TD id=MSOZoneCell_WebPartWPQ7 class=s4-wpcell-plain vAlign=top>
<TABLE style="WIDTH: 300px" class=s4-wpTopTable border=0 cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top>
<DIV style="WIDTH: 300px; OVERFLOW: auto" id=WebPartWPQ7 class=noindex allowDelete="false" HasPers="false" WebPartID="2d7a905b-9f7b-4808-a5e8-23cf0b6a9976">
<DIV class=Ramboll_PageNewsWrapper xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:ddwrt2="urn:frontpage:internal" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<H2>News</H2>
<UL>
<LI>Test news 1</LI>
<LI>Test news 2</LI>
<LI>Test news 3</LI>
<LI>Test news 4</LI>
<LI>test news 5</LI>
<LI>Test news 6</LI>
<LI>Test news 7</LI>
<LI>Test news 8</LI></UL></DIV></DIV></TD></TR></TBODY></TABLE>
<DIV class=ms-PartSpacingVertical></DIV></TD></TR>
<TR>
<TD id=MSOZoneCell_WebPartctl00_ctl28_g_1029360d_bb34_4d01_b451_ced46d866980 class=s4-wpcell-plain vAlign=top>
<TABLE class=s4-wpTopTable border=0 cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top>
<DIV id=WebPartctl00_ctl28_g_1029360d_bb34_4d01_b451_ced46d866980 class="ms-WPBody noindex" allowDelete="false" width="100%" HasPers="false" WebPartID="1029360d-bb34-4d01-b451-ced46d866980" allowExport="false">
<DIV id=ctl00_ctl28_g_1029360d_bb34_4d01_b451_ced46d866980>
<DIV class=Ramboll_ImportantPeople>
<H2>People</H2>
<DIV id=scroll class=flexcroll>
<UL>
<LI><IMG src="http://mysites-dev.ruk.rambollgrp.com:80/User%20Photos/Profile%20Pictures/ramuk_tonyb_MThumb.jpg"> <SPAN><A class=ms-imnlink href="javascript:;"><IMG id=user0 onload="IMNRC('Tony.Bassett@ramboll.co.uk')" class=presenceIndicator src="/_layouts/images/blank.gif" ShowOfflinePawn="1"></A> Tony Bassett <BR>Some Role </SPAN></LI>
<LI><IMG src="http://mysites-dev.ruk.rambollgrp.com:80/User%20Photos/Profile%20Pictures/ramuk_leez_MThumb.jpg"> <SPAN><A class=ms-imnlink href="javascript:;"><IMG id=user1 onload="IMNRC('Lee.Zebedee@ramboll.co.uk')" class=presenceIndicator src="/_layouts/images/blank.gif" ShowOfflinePawn="1"></A> Lee Zebedee <BR>some role </SPAN></LI>
<LI><IMG src="http://mysites-dev.ruk.rambollgrp.com:80/User%20Photos/Profile%20Pictures/ramuk_martb_MThumb.jpg"> <SPAN><A class=ms-imnlink href="javascript:;"><IMG id=user2 onload="IMNRC('Martin.Bissell@ramboll.co.uk')" class=presenceIndicator src="/_layouts/images/blank.gif" ShowOfflinePawn="1"></A> Martin Bissell <BR>some role </SPAN></LI>
<LI><IMG src="http://mysites-dev.ruk.rambollgrp.com:80/User%20Photos/Profile%20Pictures/ramuk_stephg_MThumb.jpg"> <SPAN><A class=ms-imnlink href="javascript:;"><IMG id=user3 onload="IMNRC('Steve.Gibb@ramboll.co.uk')" class=presenceIndicator src="/_layouts/images/blank.gif" ShowOfflinePawn="1"></A> Steve Gibb <BR>Some Role </SPAN></LI>
<LI><IMG src="http://mysites-dev.ruk.rambollgrp.com:80/User%20Photos/Profile%20Pictures/ramuk_alanhut_MThumb.jpg"> <SPAN><A class=ms-imnlink href="javascript:;"><IMG id=user4 onload="IMNRC('Alan.Hutton@ramboll.co.uk')" class=presenceIndicator src="/_layouts/images/blank.gif" ShowOfflinePawn="1"></A> Alan Hutton <BR>Some Role </SPAN></LI></UL></DIV></DIV></DIV></DIV></TD></TR></TBODY></TABLE>
<DIV class=ms-PartSpacingVertical></DIV></TD></TR>
<TR>
<TD id=MSOZoneCell_WebPartWPQ5 class=s4-wpcell-plain vAlign=top>
<TABLE class=s4-wpTopTable border=0 cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD vAlign=top>
<DIV id=WebPartWPQ5 class=noindex allowDelete="false" width="100%" HasPers="false" WebPartID="4c651259-05c8-45ed-b501-4900c4afd9f8">
<DIV class=PageLinks xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer">
<UL>
<LI>Business Development</LI>
<LI><A href="">Capability Documents</A></LI>
<LI><A href="">Project Case Studies</A></LI></UL>
<UL>
<LI>Our Capabilities</LI>
<LI><A href="">BIM/LAM</A></LI>
<LI><A href="">GIS</A></LI></UL>
<UL>
<LI>Technical Guidance</LI>
<LI><A href="">Revit User Group</A></LI>
<LI><A href="">Tips &amp; Tricks</A></LI></UL></DIV></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

Heres the xslt from sp designer

<WebPartPages:WebPartZone runat="server" Title="loc:LeftColumn" ID="LeftColumn" FrameType="TitleBarOnly"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> </td>
                    <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" valign="top" height="100%" width="100%"> 
                    <WebPartPages:WebPartZone runat="server" Title="loc:Body" ID="Body" FrameType="TitleBarOnly"><ZoneTemplate>
                    <WebPartPages:DataFormWebPart runat="server" Description="" PartOrder="2" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="True" IsIncludedFilter="" DataSourceID="" Title="Page Description" ViewFlag="8" NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal" PageSize="1" PartImageLarge="" AsyncRefresh="False" ExportMode="All" Dir="Default" DetailLink="" ShowWithSampleData="False" ListId="6dbd4268-db1a-4366-a44f-4a276ed03a9c" ListName="{6DBD4268-DB1A-4366-A44F-4A276ED03A9C}" FrameType="None" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" EnableOriginalValue="False" ChromeType="None" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" ViewContentTypeId="" InitialAsyncDataFetch="False" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ID="g_b26580e9_dfdc_4e0c_bc08_628d332c3106" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" ManualRefresh="False" __MarkupType="vsattributemarkup" __WebPartId="{B26580E9-DFDC-4E0C-BC08-628D332C3106}" __AllowXSLTEditing="true" WebPart="true" Height="" Width="655px"><ParameterBindings>
                        <ParameterBinding Name="ListID" Location="None" DefaultValue="{6DBD4268-DB1A-4366-A44F-4A276ED03A9C}"/>
                        <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
                        <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
                        <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
                        <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
                        <ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/>
                        <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
                        <ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
                    </ParameterBindings>
<DataFields>







@Title,Title;@Body,Body;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;@ItemChildCount,Item Child Count;@FolderChildCount,Folder Child Count;</DataFields>
<Xsl>







<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
                        <xsl:param name="dvt_apos">&apos;</xsl:param>
                        <xsl:param name="ManualRefresh"></xsl:param>
                        <xsl:param name="dvt_firstrow">1</xsl:param>
                        <xsl:param name="dvt_nextpagedata" />
                        <xsl:variable name="dvt_1_automode">0</xsl:variable>
                        <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
                        <div class="Ramboll_PageDescriptionWrapper">
                            <h2 class="Ramboll_PageTitle"><xsl:value-of select="/dsQueryResponse/Rows/Row/@Title"/></h2>
                            <xsl:value-of select="/dsQueryResponse/Rows/Row/@Body" disable-output-escaping="yes"/>
                        </div>
                        </xsl:template>
                    </xsl:stylesheet></Xsl>
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;/View&gt;" UseInternalName="True" UseServerDataFormat="True" ID="dataformwebpart3"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{6DBD4268-DB1A-4366-A44F-4A276ED03A9C}" Name="ListID"></WebPartPages:DataFormParameter><asp:Parameter DefaultValue="0" Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0" Name="nextpagedata"></asp:Parameter><asp:Parameter DefaultValue="1" Name="MaximumRows"></asp:Parameter>
</SelectParameters><UpdateParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{6DBD4268-DB1A-4366-A44F-4A276ED03A9C}" Name="ListID"></WebPartPages:DataFormParameter>
</UpdateParameters><InsertParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{6DBD4268-DB1A-4366-A44F-4A276ED03A9C}" Name="ListID"></WebPartPages:DataFormParameter>
</InsertParameters><DeleteParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{6DBD4268-DB1A-4366-A44F-4A276ED03A9C}" Name="ListID"></WebPartPages:DataFormParameter>
</DeleteParameters>
</SharePoint:SPDataSource>
</DataSources>
</WebPartPages:DataFormWebPart>

<WebPartPages:DataFormWebPart runat="server" Description="" ListDisplayName="" PartOrder="4" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="True" IsIncludedFilter="" DataSourceID="" Title="Page News Items" ViewFlag="8" NoDefaultStyle="TRUE" AllowConnect="True" FrameState="Normal" PageSize="10" PartImageLarge="" AsyncRefresh="False" ExportMode="All" Dir="Default" DetailLink="" ShowWithSampleData="False" ListId="9d37c9f7-347b-4a6b-8b2a-7f6bf5f67066" ListName="{9D37C9F7-347B-4A6B-8B2A-7F6BF5F67066}" FrameType="None" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" EnableOriginalValue="False" ChromeType="None" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" ViewContentTypeId="" InitialAsyncDataFetch="False" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ListUrl="" ID="g_2d7a905b_9f7b_4808_a5e8_23cf0b6a9976" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" ManualRefresh="False" __MarkupType="vsattributemarkup" __WebPartId="{2D7A905B-9F7B-4808-A5E8-23CF0B6A9976}" __AllowXSLTEditing="true" WebPart="true" Height="" Width="300px"><ParameterBindings>
                        <ParameterBinding Name="ListID" Location="None" DefaultValue="{9D37C9F7-347B-4A6B-8B2A-7F6BF5F67066}"/>
                        <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
                        <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
                        <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
                        <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
                        <ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/>
                        <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
                        <ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
                    </ParameterBindings>
<DataFields>


@Title,Title;@Body,Body;@ID,ID;@ContentType,Content Type;@Modified,Modified;@Created,Created;@Author,Created By;@Editor,Modified By;@_UIVersionString,Version;@Attachments,Attachments;@File_x0020_Type,File Type;@FileLeafRef,Name (for use in forms);@FileDirRef,Path;@FSObjType,Item Type;@_HasCopyDestinations,Has Copy Destinations;@_CopySource,Copy Source;@ContentTypeId,Content Type ID;@_ModerationStatus,Approval Status;@_UIVersion,UI Version;@Created_x0020_Date,Created;@FileRef,URL Path;@ItemChildCount,Item Child Count;@FolderChildCount,Folder Child Count;</DataFields>
<Xsl>


<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
                        <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
                        <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
                        <div class="Ramboll_PageNewsWrapper">
                            <h2>News</h2>
                            <ul>
                                <xsl:for-each select="$Rows">
                                    <li><xsl:value-of select="@Title"/></li>
                                </xsl:for-each>
                            </ul>   
                            </div>                  
                    </xsl:template>

                    </xsl:stylesheet></Xsl>
<DataSources>
<SharePoint:SPDataSource runat="server" DataSourceMode="List" SelectCommand="&lt;View&gt;&lt;/View&gt;" UseInternalName="True" UseServerDataFormat="True" ID="dataformwebpart4"><SelectParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{9D37C9F7-347B-4A6B-8B2A-7F6BF5F67066}" Name="ListID"></WebPartPages:DataFormParameter><asp:Parameter DefaultValue="0" Name="StartRowIndex"></asp:Parameter><asp:Parameter DefaultValue="0" Name="nextpagedata"></asp:Parameter><asp:Parameter DefaultValue="10" Name="MaximumRows"></asp:Parameter>
</SelectParameters><UpdateParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{9D37C9F7-347B-4A6B-8B2A-7F6BF5F67066}" Name="ListID"></WebPartPages:DataFormParameter>
</UpdateParameters><InsertParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{9D37C9F7-347B-4A6B-8B2A-7F6BF5F67066}" Name="ListID"></WebPartPages:DataFormParameter>
</InsertParameters><DeleteParameters><WebPartPages:DataFormParameter ParameterKey="ListID" PropertyName="ParameterValues" DefaultValue="{9D37C9F7-347B-4A6B-8B2A-7F6BF5F67066}" Name="ListID"></WebPartPages:DataFormParameter>
</DeleteParameters>
</SharePoint:SPDataSource>
</DataSources>
</WebPartPages:DataFormWebPart>
share|improve this question
add comment

1 Answer

surround each one with a div element, give both divs unique class names. Then use css to make them side by side like so:

.list1
{   
    float:left!important;
    display:inline-block !important;
}

.list2
{
    float:left!important;
    display:inline-block !important;
}

you can also start to play around with it, using position aswell :)

hope it helps :)

share|improve this answer
    
hi thats what i did but the divs i created are wrapped in td tags –  Richard Banks Sep 17 '12 at 16:02
    
where abouts are you adding the divs? without seeing any code i cant help! are those first two divs the ones you added? if you add them before the control is created it would be on the outside of the table else it will be in the inside of the table. regardless weather you have both indide the TD you should still beable to put them side by side unless the are in seperate td tags created by sharepoint, if both are in the td then thats good as they both occupy the same cell –  ali Sharepoint Sep 17 '12 at 16:20
    
The divs are created in the xslt that i changed. I tried moving the divs to wrap the webpart but now i get an error about invalid content in zone. ill add the code –  Richard Banks Sep 17 '12 at 16:34
    
there both in seperate td's as well –  Richard Banks Sep 17 '12 at 16:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.