Let\'s say I have a div
which will contain a set of elements (divs), which may have different heights, but all of them will have the same width.
I\'ve a
You can use jQuery to rearrange items in columns. In case of 2 cols it would be:
$('.your-columns-container .your-item:nth-child(even)').appendTo('.your-columns-container');
https://jsfiddle.net/hzvp7sgf/
And something more complicated for 3 columns:
$('.your-columns-container .your-item:nth-child(3n - 1)').addClass('container-col2');
$('.your-columns-container .your-item:nth-child(3n)').addClass('container-col3');
$('.container-col2').appendTo('.your-columns-container').removeClass('container-col2');
$('.container-col3').appendTo('.your-columns-container').removeClass('container-col3');
https://jsfiddle.net/d4LeLyu5/