I'm dynamically creating sets of radio buttons and am looking for a way to arrange them in a height specified area.

An example of a horizontal layout is as follows:

<div>
    <div style="width:100px;float:left;">Test</div>
    <div style="width:100px;float:left;">Test</div>
    <div style="width:100px;float:left;">Test</div>
</div>

In the above case, you can adjust the width of the parent div and the children will realign and start stacking above one another.

I'm looking for similar behavior, however vertically instead of horizontally.

ie:

1   4   7
2   5
3   6

instead of:

1   2   3
4   5   6
7

Any assistance is appreciated.

2 answers

Doug 1095
2
points

Not an easy thing to do with CSS2. See this article, CSS Swag: Multi-Column Lists, from 2005 for a variety of attempts. CSS3 has multi-column layouts, but browser support is still limited right now. There are JavaScript workarounds, of course.

Answered about 9 years ago by Doug
1
point

I am not sure if this is what you need but it may be an option: jQuery Masonry

Answered about 9 years ago by TailorDMI