I have a red div at a fixed position : top and bottom are fixed.
This div contains a table in which a cell contains a scrollable div, so that the content can't overflow the red div.
It looks like this on Chrome :
But on Firefox, the content grows and overflows out of the red box :
Here's my HTML :
<div id=a>
<div id=b>
<table id=c border=1>
<tr><th height=20 width=20>
<input type=button id=but value="Fill cell">
</th><th>A</th></tr>
<tr><th>dataname</th>
<td><div id=val class=scrollable>cell content</div></td>
</tr>
</table>
</div>
</div>
and the CSS :
#a {
position:fixed; top:20px; left:20px; bottom:50px;width:200px;
background:red;
}
#b { height:100%; }
#c { width:100%; height:100%; }
.scrollable {
width:100%; height:100%;
overflow-y:auto;
}
And here's a fiddle for the tests : http://jsfiddle.net/xusqc/
I'd suggest you test your proposal on FF before submitting an answer.
How could I fix my code to have on Firefox and IE9+ the behavior I have now on Chrome ?
Note that the height of the first line of the table may change dynamically in my application. And the solution must be applicable if my data table has more rows and cells.