I tried this for a while and I didn't seem to find a solution.
HTML:
<table> <tr> <td> <div>this div has to expand over the td padding</div> </td> </tr> </table>
CSS
table { height:100%; } td { height:100%; background: green; padding:5px; } div { min-width:100%; height:100%; background:yellow; float:left; white-space:nowrap; }
I want the div to expand exactly as much as td, but also expand over the filling of td.
Moving the indentation to the div element is not a solution, since the div must be 100% height and at least 100% width, the rest of the div width is full: hidden and appears on hover, but I'm trying to keep the example as simple as possible, therefore I did not include it here.
Edit:
@codehorse I tried your approach, but now it seems that the div is expanding to the whole body, so I think that Era is right, relative positioning may not work on td. I could use a different shell between td and div, but I would like to avoid this if possible. I am looking for a standard solution.
@Era works great Thanks!
source share