tags:

views:

36

answers:

2

I want to achieve this thing: alt text

Height of table row and grey line should be dynamic depend on contents in right column.

I've read in http://stackoverflow.com/questions/3542090/how-to-make-div-fill-td-height, so I tried with this http://jsfiddle.net/hyNWy/

But still no luck. Any suggestions?

+1  A: 

With a colon? Also, to get your spacing:

<td style="position:relative;">
    <div style="width: 10px; position:absolute; top:10px; bottom:10px; background:grey">
    </div>
</td>

EDIT:

I don't think it's possible without specifying an explicit height. The solution in the original question that you pointed to does not actually work. position:relative does not seem to apply correctly to table cells. This could well be intentional and part of the spec.

Eric
Code removed here http://jsfiddle.net/hyNWy/. As you can see, the height of div fill out the browser not parent's row.
Jeaffrey Gilbert
Alright then, thanks mate.
Jeaffrey Gilbert
+1  A: 

Did you try this ?

Chouchenos
How about this http://jsfiddle.net/hyNWy/10/? The height I defined just example, not fixed. It should be fluid vertically.
Jeaffrey Gilbert