[whatwg] Definition list and tables: what's the difference ?

David Latapie david at empyree.org
Mon Feb 12 15:24:33 PST 2007


The title may seem silly: tables are completely different from 
definition lists; the only similarity is that they are both block 
elements.

Well, on the presentational level, I could not agree more. But when you 
come to think to the semantics, I am not so sure.

What follows is pure speculation from me -- not a request for any 
change, just some thoughts I would like your opinion on. Because I 
truly wonder if <dl> and <table> are different enough. Maybe this is 
just theoretical (practicability/compatibility may render the whole 
idea useless), but I would still like your opinion, especially 
considering the amount of talented people on this list.

With no further ado, my reasoning:

A definition list (<dl>) provides a relationship between an important 
element (<dt>) and a less-important one (<dd>). One might argue the 1:1 
ratio is not necessary; One can think of two <dt> for one <dd> or, more 
often, one <dt> and, say, three <dd>.

In a table, the same relation exists between <th> and <td>. Also, both 
<dl> and <table> are block elements (which, IMHO, doesn't matter when 
we talk of semantics).

There is not a mere redundancy here: <table> is able to represent more 
complex relations than <dl> can
• <caption> has no equivalent in <dl> (LH didn't made it in HTML 3.0)
• <dl> may only have one relationship (<dt> to <dd>, even with multiple 
<dt>/<dd>) whereas <table> may have two (maybe more, but I am not sure)

            TH TH TH

     TH     TD TD TD
     TH     TD TD TD
     TH     TD TD TD

(I don't know the English name for such a table; Double entry table?)

I'm sure there is detail I could find, but I'll stop here.

Oh, one more thing: we used to bash tables, because they were used for 
layout instead of pure “tabular data” (layout table vs. Excel-like 
tables) but I think there is a “gray zone” inbetween that is currently 
addressed by <dl>. And everything <dl> does, table can do it better on 
a semantic point of view.


So, this is my thinking. It certainly is full of misconceptions and 
oversights, would you be so kind as to give your impressions on it?
-- 
</david_latapie>             U+0F00
http://blog.empyree.org/en (English)
http://blog.empyree.org/fr (Français)
http://blog.empyree.org/sl (Slovensko)


More information about the whatwg mailing list