I have a basic grid system, really basic, which puts to 'cells' side by side in a fluid 'row'. I want the two cells to always match their height so they are equal. So if one has more content than the other, the other expands to match the height of the cell with more content.
<div class="row">
<div class="cell1">
<div class="inner">
<h2>Cell 1</h2>
<p>Regardless of content, can I make Cell 1 and Cell 2 the same height so the borders are level?</p>
</div>
</div>
<div class="cell2">
<div class="inner">
<h2>Cell 2</h2>
</div>
</div>
</div>
Demo of the problem here: http://jsfiddle.net/QDBff/
I made it work here with the use of jQuery: http://jsfiddle.net/QDBff/10/
Change the border from Inner class to Cell1 and Cell2 classes. Then give fixed height to the Cell1 and Cell2 classes.
Here is the fiddle http://jsfiddle.net/QDBff/31/
Add a large padding bottom and an equal negative margin bottom to your cells and stick
overflow: hidden
onto your row.Example here:
http://jsfiddle.net/Q9U6g/1/
I've checked your fiddle and I think it may be fixed by adding a min-height of 270px (for ex. only).
I am not a jsfiddle user, but look at my screen shot below...
Note:
You just have to tweak your min-height to fit your needs. Tweak is necessary whenever the text size increases or decreases.
But, if your content is dynamic, this is not a permanent solution.
If you absolutly must avoid using TABLEs, you can style your divs to behave like tables with
You can look at the markup/css and results in this fiddle: http://jsfiddle.net/aeinbu/QDBff/35/
<table><tr><td>Cel 1</td><td>Cel 2</td></tr></table>