serdar, that's a neat little page :-) although I think the OP was after something a little different.
Correct me if I'm wrong, but I'm guessing you are dynamically adding columns to a "floating-column" layout - your container div is centered on the page, and you want the container div to expand in width every time a new column is added.
Surely the easy way to do this is to recalculate the width very time you add or remove a column using Javascript? If you have five or more columns, new columns get a width of 100px and you add 100px to the width of your wrapping <div>. If you have less than 5 columns, then fix the width of your wrapping <div> and set the width of each column to be <width of wrapping dix> / <number of columns>.
Please, also in future, post a link to your site so we can:
- Check the markup to ensure it's valid;
- Check for Javascript errors and other cross-browser related stuff which you might not have thought of;
- See ALL of your CSS code. A couple of lines is all well and good but CSS suffers from this thing called inheritance, so to determine CSS issues we need to see ALL your CSS, not just the bits you think are getting applied by class or by ID.
Please post your URL so we can take a good look at your code to determine if there's any bugs and make any further suggestions. Help us to help you!
codegecko
Moderator