Re: [CSS21] Concern about anonymous table objects and whitespace

Also in the wild are items with "display: table-cell" whose parent  
elements do not have any table-* display values. Such as this one:

http://www.ehow.com/how_4623385_use-css-display-table-cell-property.html

...which was the #6 result in my Google search of "css display table- 
cell" (without the quotes). It is a tutorial, and there are others  
there too that show how to use "table-cell", but don't mention any  
necessity for a "display:table-*" parent. The #1 result, a page from  
QuirksMode [1], has this text, in regard to using "display: table- 
cell": "Safari and Chrome require elements with display: table and  
display: table-row to show the cells correctly. The other browsers  
don't."



On Jan 23, 2009, at 8:09 AM, Boris Zbarsky wrote:

>
> Tab Atkins Jr. wrote:
>> Well, only if you're throwing around table-* display types, which
>> despite their usefulness are still definitely minority display types
>> (and I expect them to stay that way).
>
> Interestingly enough, I actually came across a use case my proposal  
> would break this morning.  See http://stackoverflow.com/questions/471636/centered-ul-wont-expand-horizontally-in-ff-opera-works-in-safari-ie6-7-8 
>  (which links to an example page at http://deadguy.reliccommunity.com/stuffbox/testinggrounds/display-table.html 
>  in case the stackoverflow page goes away).
>
> The markup basically looks like this, stripped down:
>
>  <ul style="display: table">
>    <li style="display: inline-table">
>      <h1 style="display: table-cell">Some header text</h1>
>      <dl style="display: table-cell">
>        <dt style="display: inline">Something</dt>
>        <dd style="display: inline-block">Something else</dd>
>        <dt style="display: inline">And more</dt>
>        <dd style="display: inline-block">And yet more</dd>
>      </dl>
>    </li>
>  </ul>
>
> except there are several such <li> blocks.  So it seems like this  
> sort of thing really is being used in the wild, and this isn't even  
> a completely ridiculous use case (just want a table with the list- 
> items as cells, but each list-item is also a table itself).
>
>> I can see problems in the case that, say, a display:table container
>> gets switched to display:block, perhaps by script, which would cause
>> its contents to be completely suppressed.  Is it possible for CSS to
>> do a display-orphaning, analogous to the normal table orphaning but
>> without actual DOM changes?
>
> I don't think that would be desirable....
>
>>> He also pointed out that there is existing spec text that requires  
>>> the sort
>>> of lookahead that makes me unhappy, and in particular that blocks  
>>> inside
>>> inlines require it.
>> Is that truly a display issue, or is that part of the HTML algorithm?
>
> Display.  We're talking things like:
>
>  <div style="display: inline">
>    <div style="display: block"/>
>  </div>
>
> -Boris
>

Received on Friday, 23 January 2009 17:42:10 UTC