I am trying to create a dynamic grid which contains tiles - there is one row and the grid columns have a % width.
At larger resolutions, the width might be 30% but at lower resolutions it might be 50% or even 100% - they are all floated left and this works fine for widths.
The issue is when one of the columns has more content than the others hence is taller and it messes up the grid system and user could end up with row of 3 then row of 1 then row of 2.
I can't use min/max height in CSS as, depending on the user, the div might have 10 words or 1000 words. The "row" is actually a wrapper div as it incorporates multiple "rows" so setting a height on that doesn't work either.
How can I create a dynamic responsive fluid grid layout using something like the below where all widths are the same and all heights are the same as the highest box - I don't mind using JS/jQuery if it is needed which I suspect it will be.
<div id="row">
<div class="col">COL1</div>
<div class="col">COL2 Text added to this column so height is different</div>
<div class="col">COL3</div>
<div class="col">COL4</div>
<div class="col">COL5</div>
<div class="col">COL6</div>
</div>
#row {
float:left;
border:1px solid red;
}
.col { float:left;
width:30%; border:1px solid black; margin:1%;}
@media screen and (max-width: 400px) {
.col {width:45%;}
}