Sowmya Sowmya - 1 month ago 6
HTML Question

Filling the available space with display:table-cell

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

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