Re: Request for ::di pseudoelement

On 12/21/2009 8:30 PM, Tab Atkins Jr. wrote:
> <table>  certainly provides all the structure one needs, but it doesn't
> feel like the semantically right element to use - I'm presenting
> key/value pairs, not 2-dimensional data.

What's the difference between "key/value pairs" and "2-dimensional data" 
exactly? The two constructs below appear to me to be identical in terms 
of semantics:

<table>
   <tr>
     <th>Term</th>
     <td>Definition</td>
     <td>Definition</td>
   </tr>
</table>

<dl>
   <di>
     <dt>Term</dt>
     <dd>Definition</dd>
     <dd>Definition</dd>
   </di>
</dl>

The only differences seem to be (A) default rendering, (B) that you have 
to create empty cells to accommodate the term with the most values, and 
(C) that the former allows for different styling options.

Issues (A) and (B) can be addressed like so:

<table>
   <tbody>
     <tr><th scope="rowgroup">Term</th></tr>
     <tr><td>Definition</td></tr>
     <tr><td>Definition</td></tr>
   </tbody>
</table>

That's somewhat verbose though; |di| would seem to make more sense if 
you don't need the extra elements and want fairly standard styling. I 
have to wonder why such a frequently requested element is still not in 
the HTML5 spec.

Received on Tuesday, 22 December 2009 10:12:45 UTC