1

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?

1 Answer 1

3

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.

1
  • 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
    Commented Aug 22, 2011 at 5:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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