- From: Patrick Garies <pgaries@fastmail.us>
- Date: Tue, 22 Dec 2009 04:12:12 -0600
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- CC: www-style <www-style@w3.org>
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