Forum Moderators: not2easy
My entire site has been coded using XHTML/CSS, and no tables for layout. I've hit a bit of a stumbling block with forums though.
Here's how I'd do it with tables :
<tr>
<td>User info</td>
<td>
<table>
<tr><td>Message summary</td></tr>
<tr><td>Message Content</td></tr>
</table>
</td>
</tr>
I'm thinking of using <dl> like this :
<dl>
<dd>User info</dd>
<dt>
<h2>Message Summary</h2>
<p>Message content</p>
</dt>
</dl>
any thoughts?
<table>
<tr><td>Message summary</td></tr>
<tr><td>Message Content</td></tr>
</table>
<p>Message summary</p>
<p>Message Content</p>
Perhaps you mean
<table>
<tr><td>Message summary 1</td>
<td>Message Content 1</td></tr>
<tr><td>Message summary 2</td>
<td>Message Content 2</td></tr>
...
<tr><td>Message summary n</td>
<td>Message Content n</td></tr>
</table>
If so, this is the way to do it, since you are dealing with tabular data. Each message is is an entity, with the attributes "summary" and "content". But you don't need to nest the table in another one.
The corollary of not using tables for layout is not using CSS to handle tables :-)
I'm really not sure that using a DL is a good idea.
What advantage do you gain? Are they any easier to access than tables or divs?
however, if you did use it then the correct markup would be more like this..
<dl>
<dt>User</dt> <dd>grahamstewart</dd>
<dt>Date</dt> <dd>25th Feb 2004</dd>
<dt>Message</dt> <dd>Hello</dd>
</dl>