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.
In "Table Tools" click the [Layout] tab > locate the "Cell Size" group and choose from of the following options: To fit the columns to the text (or page margins if cells are empty), click [AutoFit] > select "AutoFit Contents." To fit the table to the text, click [AutoFit] > select "AutoFit Window."
Make a new div with whatever name (I will just use table-split) and give it a width, without adding content to it, while placing it between necessary divs that need to be separated. You can add whatever width you find necessary.
You need to set the margin of the body to 0 for the table to stretch the full width. Alternatively, you can set the margin of the table to a negative number as well.
Set display:table; width: 100%;
on the parent element, remove float: left
from the sibling.
http://jsfiddle.net/byNpM/2/
It is possible to use table layout to do this, but it's not necessarily the easiest way: forked your fiddle to demonstrate.
An easier way is to modify the second cell to remove all table display properties and set the second element's overflow
to hidden
: another fork demonstrating this. zoom: 1
allows the technique to work in old IE. This might be simpler for your purposes, if you're happy with the side-effects of the overflow
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With