Filling the available space with display:table-cell

Sowmya picture Sowmya · Feb 27, 2013 · Viewed 13.9k times · Source

Is it possible to avail the second div to occupy the available space of the parent div without specifying manual width?

Here is the Fiddle for the tried demo.

.right_cnt {
    display: table-cell;
    background:#FFC;
}

NOTE: I need yellow box to occupy the available right space.

Answer

Tetaxa picture Tetaxa · Feb 27, 2013

Set display:table; width: 100%; on the parent element, remove float: left from the sibling. http://jsfiddle.net/byNpM/2/