views:

83

answers:

3

How can i achieve this layoutalt text (now its done with tables) and still have semantic markup, i guess the best suited tag for this would be dl. Every cell must have the height of their row.

EDIT: the left column contains the description and the right the data. So i don't think this is well suited for tables. It would be if i would move the description to the table head, but that would take 2000 px width

+1  A: 

If it's tabular information, then a table is not the best, it's the only sensible way to display it - that's what tables were made for!

To be a bit more formal about it, the semantics of your data is indeed tabular, there's no reason in the world to lie about it.

Carl Smotricz
The highly annoying CSS purist zealot crowd has struck so much fear of tables into peoples' hearts that now they're hesitant to use them even for tabular data! *grumble*
Carl Smotricz
no not at all, maybe i wasn't clear enought explained: the left column contains the description and the right the data. So i don't think this is well suited for tables. It would be if i would move the description to the table head, but that would take 2000 px width
antpaw
A table with headers is still a table. There are column headers and row headers; your descriptions are row headers. I still think you're seeing a problem that isn't.
Carl Smotricz
It's beginning to look more and more like a Definition List to me. Not a *perfect* DL, but if you squint just a bit ...
pavium
+1  A: 

I would use a <dl>, because it is just 2 columns.

DaMacc
yes that's where the problem begins! Every cell must have the height of their row.
antpaw
I was going to protest, because a "standard" DL layout has the items on the next line from the headers, and sometimes overlapping. But of course CSS allows you to fix up the format to look nice.
Carl Smotricz
+1  A: 

If you are concerned about the semantic and think that this is the reason why a definition list is better suited, read this official document about definition list.

It says:

Definition lists, created using the DL element, generally consist of a series of term/definition pairs (although definition lists may have other applications)

and

Definition lists vary only slightly from other types of lists in that list items consist of two parts: a term and a description.

That means the term (e.g. Anrede) is described/defined by its description (e.g. Herr ). We can argue here, but Herr is not really a description of Anrede it is more one possible value/word (data) you can use as Anrede. And a definition would be

A way to address persons, depending on gender, graduation etc.

Btw for all non german speakers, Anrede means salutation.

Of course there are exceptions but from an semantic point of view, a table fits better.


All I want to say is: Don't burden yourself with such things. To get this looking the same with DL tags and CSS is not worth the effort. To use a table for your data is fine, really.

Felix Kling