Is there a disadvantage of using `display:table-cell`on divs?

display: table-cell is perfectly fine to use, with just one downside..

It doesn’t work in IE7 (or IE6, but who cares?): http://caniuse.com/#search=css-table

If you don’t need to support IE7, then feel free to use it.

IE7 still has some usage, but you should check your Analytics, and then make a decision.


To answer your specific use case, you can do it without display: table-cell, provided that you don’t need the height to adjust based on content:

http://jsfiddle.net/g6yB4/

<div class="clearfix">
  <div style="float:left; width:100px; background:red">some content</div>
  <div style="overflow:hidden; background:#ccc">some more content</div>
</div>

(why overflow: hidden? With: http://jsfiddle.net/g6yB4/3/ vs without: http://jsfiddle.net/g6yB4/4/)

Leave a Comment