Re: Position: relative and table cells

François REMY <francois.remy.dev@outlook.com> a écrit :

> Hi,

Hello François,

>
> I know this is not the right place for CSS questions,

Huh... as far as I am concerned, this list is an excellent place for  
CSS questions. This place should be a good place for understanding CSS  
specifications.


> but I’ve a test case that works differently accross browsers and I’m  
> totally unable to say what’s the expected result. The test case is  
> the following one:
>
>     table {height:50px;}
>         tr
>             td { position: relative; }
>                 div { position: absolute; top: 0px; left: 0px;  
> right: 0px; bottom: 0px; }
>                     ...
>

This is not the first time I see code like this. People are mixing CSS  
positioning with table layout. There must be some sites which are  
promoting use of this.

> In Opera & Chrome the DIV is sized as I would excect (50px wide, 50px tall)
> In IE, it’s positionned just fine, but has no height (50px wide, 1px tall)

Related to this but not exactly the same:

Bug 789352: Content within table row does not expand the row's height
https://connect.microsoft.com/IE/feedback/details/789352/content-within-table-row-does-not-expand-the-rows-height

Height percentage for table rows is undefined.

> In FireFox, the position: relative of the TR is partly ignored (the  
> div takes the whole viewport, but is still z-index-nested in the  
> table cell; that one make no sense).
>
> My question is: Is that behavior expected to be undefined,

Like others said: this is undefined.

> or should I actually report bugs for this?

Bug 35168: relative positioning of table cells doesn't work
https://bugzilla.mozilla.org/show_bug.cgi?id=35168

Gérard

Received on Thursday, 13 June 2013 17:59:33 UTC