Log in

View Full Version : Semantics



jeaux
08-18-2008, 02:00 PM
I'm doing a menu for a restaurant and needed some PHP help earlier. Twey the moderator of the forum brought to my attention that it would be more proper to place my menu inside of a table.

This is the format that I'm currently using.


<h2 class ="menu-category">TAPAS FRIAS</h2>
<dl>
<dt>Ensalada de Pollo</dt>
<dd class ="price">$5.95</dd>
<dd class ="ingredients">Grilled chicken breast over mixed greens, tossed in a balsamic vinaigrette.</dd>
<dt>Alcachofas Estofadas</dt>
<dd class="price">$6.95</dd>
<dd class ="ingredients">Braised artichokes with serrano ham, sweet pea salad, walnut dressing, and manchego cheese.</dd>
<dl>

My view was that the 2 <dd>s did indeed define the <dt> and was therefore the proper format.

What's your opinion? Is a table the correct semantic approach?

Thanks,
Joe

jscheuer1
08-18-2008, 02:04 PM
Whatever you like is generally fine as long as it doesn't cause any problems. However, tables are specifically for tabular data like a restaurant menu or price listings.

jeaux
08-18-2008, 02:24 PM
I went through a massive pain writing alternative style sheets for IE to get it just right, and it turns out I was barking up the wrong tree. A table would have been so much easier.

Live and learn. I appreciate the patience and descriptiveness that the moderators here have. Twey went through a lot of trouble to help me.

Sincerest thanks,
Joe

Twey
08-18-2008, 02:47 PM
The 'ingredients' <dd> is indeed a definition, but the 'price' isn't -- it's associated information, it doesn't describe the term. Note that semantically, a definition list is a subset of a table (it's basically tabular data).