We currently use tables to lay this out but would like to get rid of them.
We have a list of 10 country names that we display 5 in one table cell and the next 5 in the next cell so that they display like 2 lists of 5 countries next to each other.
Ideally I would like to markup the list of 10 countries as a single list and have css take care of splitting it into 2 instead, if it can do this.
I’m thinking there might be some way to limit the size of the container element perhaps and have the display move to the left and keep going so it looks like 2 lists of 5 elements each but semantically is just one list of 10. Does that sound like it should be possible?
Yes it can extend to 1000 columns as long as the parent has enough width to fit them all :). You will have to mess with the widths though to fit however many columns you will be creating.
You will also need to add a class to the <li> for whatever column (as Paul did for the <li>'s belonging to the second column)
That is what I would like to avoid doing. I want just one <ul> element ad have the layout done with css.
We generate the xhtml markup dynamically from server-side code so wish to have complete independence between the structure of the xhtml and the design.
For example if we altered the server-side code to give us 3 <ul> elements because the design wanted that and then someone came along and wanted to redesign the front-end to have 4 then we would have to go back and alter the servce-side code to accomplish this. It’s this interdependence that we want to break.
Yes that’s what I meant but I knew that it wasn’t what you really wanted :). You will have to wait for css3 to be implemented in all browsers and the multi column modules will cater for this sort of thing properly.
The only alternatives are relatively messy and involve adding classes and manipulating with negative margins etc and rely on lines being of equal height.