Skip to content

Instantly share code, notes, and snippets.

@yoelnacho
Created November 14, 2013 04:27
Show Gist options
  • Save yoelnacho/7461352 to your computer and use it in GitHub Desktop.
Save yoelnacho/7461352 to your computer and use it in GitHub Desktop.
equal-height-columns.css
.css-table {
display:table;
width:500px;
background-color:#F9F9F9;
}
.css-table-cell {
display:table-cell;
width:30%;
padding:3%;
}
.css-table-cell:nth-child(2n+1){
background-color: #cacaca;
}
<div css="css-table">
<div class="css-table-cell"></div>
<div class="css-table-cell"></div>
<div class="css-table-cell"></div>
</div>
@fabiorochafg
Copy link

I'm not sure if display:table-cell will work OK in every browser...

@yoelnacho
Copy link
Author

@fabiorochafg
Copy link

Thanks, dude!!! I'm gonna ignore IE7, it's the best solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment