Forum Moderators: not2easy

Message Too Old, No Replies

best markup to use for forums

to table or not to table...

         

phpologist

9:41 am on Feb 25, 2004 (gmt 0)

10+ Year Member



I'm trying to decide the best way to markup my message forums from an accessability point of view.

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?

TheDoctor

10:47 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



phpologist, You seem to be using tables (in your hypothetical example) to lay out the items one line at a time. Are you sure you mean that? I don't see the difference between

<table>
<tr><td>Message summary</td></tr>
<tr><td>Message Content</td></tr>
</table>

and
 
<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 :-)

grahamstewart

11:09 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I assume phpologist is talking about how to markup the actual messages themselves, not the list of messages (i.e. how would you mark up this discussion?)

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>

TheDoctor

11:24 am on Feb 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, I think I completely misunderstood the question.