Whipped up in a very short period of time for stitchd, the idea behind this plugin is to evenly distribute child elements horizontally across fluid css layouts.
A table doesn't quite do the job for this as:
The example loads in a new window so that it is easily resized to see the plugin in action.
You need to tell the plugin when to update the positioning of elements so at a minimum i would suggest triggering it at page load and on window resizes, like so:
$(window).resize(function(){
$('#boxes').distribute();
});
$('#boxes').distribute();
There are currently only two options for this plugin.
marginThis allows you to set a minimum margin between elements
$('#boxes').distribute({'margin': 20});
widthYou can also explicitely set the width of child elements, otherwise the plugin will use the width of the first element. This behaviour may be enhanced in the future.
$('#boxes').distribute({'width': 200});
The plugin can be downloaded from the public repository on github.
If you have any comments you can find me @tommoor on twitter