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

On SharePoint 2010, is it possible to correctly use float:right on a DIV and have web parts flow to its left in another DIV? I've tried this but the web part ignores the float and writes its content on top of the DIV that's floated right.

<div style="float:right">float right div content goes here</div> 
<div id="my-web-parts">Web parts go here</div>

If I don't use web parts in the left DIV, it works correctly and wraps around the float:right DIV. Is this because web parts use tables? What am I doing wrong?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

As you have mentioned Web Parts are rendered using tables by default. If you want to use a div-based layout, you would very likely have to use a Control Adapter that would remove tables surrounding Web Parts and render only the divs. Please note that using such Control Adapter breaks the editing experience and the Web Part Page Service Component so preferably you would use it only for anonymous users/display mode.

share|improve this answer
    
Thanks, Waldek. I wonder if the next version of SharePoint will provide a better solution. Tables make sense when presenting tabular data but not so much for layout. –  Alex C Aug 22 '11 at 5:09
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.