I want to arrange some items in a column. I can't predict the width or height of the item, nor the width or height of the container. I also can't predict how many columns will fit or what the width of the columns should be. I want the browser to arrange the items in the maximum number of columns without exceeding the width of the container, while minimizing the height of the container.
This solved the problem, but is there a better way? Can this be achieved without using jQuery? Can it be done in a way that older browsers will display it properly (perhaps by arranging it in rows instead of columns)?
123456789
You can use a grid to achieve this