So here is the problem: I have 6 sections that use jQuery UI sortable . They are located as shown in the image below.

The image is the layout I'm looking for, equal distance between each of the divs, but with ends up along the edges of the container.
My understanding is that this cannot be done, for example, with setting margin-right: 10px on all of them and deleting the fields on the 3rd and 6th elements, since they can be dragged to another position, so they no longer will be in 3rd and 6th position.
I donโt think that this can be done by adding each section to the column div and setting connectWith in the jQuery sort setting, since this set of 6 is inside the div that is linked to other lists, and I donโt think you can have connectWith: '.connectedSortable .column 'anyway.
I also tried using the: nth-child (n) pseudo-class, but could not correctly update the fields when moving the elements: (
Here you can view jsfiddle> http://jsfiddle.net/hC5Qy/1/
Currently, the width of the boxes is 32%, the idea is that I can set 2% of the right / left margin on two of the boxes to give 100% (32 + 32 + 32 + 2 + 2 = 100).
So any ideas?
Are there any ways to use javascript? Can any new CSS3 or HTML5 layouts be used to center the middle box? (I'm not worried about the compatibility of the old browser).
Any help is much appreciated!
thanks
[edit: some code from the script]
HTML:
<div id="area1" class="connectedSortable"> <div class="block"><span style="font-size:3em; color:#CCC;">1</span></div> <div class="block"><span style="font-size:3em; color:#CCC;">2</span></div> <div class="block"><span style="font-size:3em; color:#CCC;">3</span></div> <div class="block"><span style="font-size:3em; color:#CCC;">4</span></div> <div class="block"><span style="font-size:3em; color:#CCC;">5</span></div> <div class="block"><span style="font-size:3em; color:#CCC;">6</span></div> </div>
JS:
$(function() { $(".connectedSortable ").sortable({ connectWith: ".connectedSortable" }); $(".connectedSortable").disableSelection(); });
CSS
#area1, #area2 { border:1px solid red; float:left; width:680px; margin-bottom:15px; background:#ccc; } .block { background:green; width:32%; height:200px; float:left; margin-right:1%; margin-top:10px; }