odiseo
odiseo

Reputation: 6784

Fixed/frozen left column in table...but when table is wrapped

I have a very similar scenario to the one described in how do I create an HTML table with fixed/frozen left column and scrollable body?. Essentially, that works for me but I need my table to be contained in a div which will be sitted next to another div (so, the scrollable table will have an options panel on the left side). The structure is:

<div id="wrapper">
 <div id="first"></div>
 <div id="second"><table>All table contents here...</table></div>
</div>

Unfortunately the solution proposed in the original question doesn't seem to work when the div is sit next to another, the absolute positioning of the left column will take it all the way left. See a fiddle here http://jsfiddle.net/odiseo/YMvk9/7106/

Upvotes: 1

Views: 83

Answers (1)

jaunt
jaunt

Reputation: 5089

Okay so you could do the following: Replace left:0 in .headcol with transform: translatex(-5em); and then add float:left; to #second.

Upvotes: 1

Related Questions