I have been struggling with this problem for quite some time and cannot find the right solution to my problem.
What I have:
<div style="width:150px; border:1px solid #000;overflow: auto;"> <div>SOME TEXT</div> <table style="width:100%; border:1px solid #0F0;"> <tr> <td>HEAD1</td> <td>HEAD2</td> <td>HEAD3</td> </tr> <tr> <td colspan="3"> <div style="overflow: auto; border:1px solid #F00;"> <table> <tr> <td>HEAD</td> <td>HEAD</td> <td>HEAD</td> <td>HEAD</td> <td>HEAD</td> </tr> <tr> <td>QQQQ</td> <td>QQQQ</td> <td>QQQQ</td> <td>QQQQ</td> <td>QQQQ</td> </tr> </table> </div> </td> </tr> </table> </div>
http://jsfiddle.net/37ExS/
Explanation:
The outer div represents my fixed-link content wrapper that contains some other divs and a data table. Inside the data table is a row that contains another table with details regarding the row above it.
What I want:
In the cell of the table that currently has the column number "3" containing the details table, it should have an overflow of content, creating a scroll bar. This is why I wrapped the content in another div, but it looks like the width of the div is determined by its content, not the width of its parents (TD). setting a fixed width for inner div works, but I want it dynamically since I really don't know the width of the content shell.
Hope this was clear.
UPDATE:
Here's how it should behave: http://jsfiddle.net/eRA33/
I could use this and be fine, but I really don't know cross-browser support, and it looks a bit hacked to me, it would be nice if someone had a better way to do this.
source share