views:

57

answers:

6

Hello. I have a group of emails (I hesitate to use the word list, as it may prejudice you answers), which I want to display in a tabular manner with columns of Subject, Content, Date, Action (whose value may contain a Delete button, for example).

Semantically speaking, would you use a list (<dl>, probably) or a <table> for this data? My gut feeling is that a list is most appropriate: I would describe the page as a list of emails after all - not a table of emails; furthermore, I would not put this data in a spreadsheet or perform any analysis on it. However, the fact that I want column headings makes me wonder if a <table> is more approprate.

I doubt that the design would ever be non-tabular; however, it is possible that certain columns may be restyled.

A: 

Don't worry about styling. You can use CSS to make a list look like a typical table, or a table look like a typical list. Aside from that, it's up to you. To me, especially as there are very few 'column'-like data pieces, a definition list seems more semantically and practically correct for this situation.

Delan Azabani
+3  A: 

I’d go for the table. If it had just one column, I’d use the list, but—to me, at least—this is clearly tabular data, since all “rows” share the same “columns”.

(Thinking of it: if your example did not qualify for the use of a table, what else would?)

igor
data from which you could plot a graph would always go in a table. you cannot plot a graph from a list of emails. (I'm not saying that if you can't plot it then it shouldn't go in a table, by the way.)
darasd
I'm going to accept your answer with some further explanation. It's the need for headers that requires a table, as HTML has no way of associating headings with <dt> elements. In some ways, this is the job of the <dd> element, but when it is associated with multiple <dt> elements, then it would be nice to be able to give each a heading; unfortunately this is not possible, hence the need for a table.
darasd
A: 

<table> all the way. You can put what you like in the <div> in the cell. Works for gmail (at least, for their basic html view).

Tim Kemp
see my comment to @klez. google don't appear to care about semantics.
darasd
"Semantics" in the context of displaying things is entirely different to semantics when considering data models. HTML is a presentation markup language and that is how you must use it. It is therefore "semantically correct" to use a `<br>` tag to introduce a visual break on the page, just as it is fine to use center tags, tables and so on to center things or show them in tabular format. You want to show a table on the screen; the `<table>` tag is just for that. What's in that table is irrelevant in terms of presentation layer semantics. Saying "Google don't care" just sounds silly.
Tim Kemp
A: 

I'm not sure one is better than the other, personally, I would use tables.

Or W
A: 

GMail uses a table. I wouldn't say they don't care about semantics.

klez
I would certainly say that they don't care about semantics. Look at google's home page - centre tags, tables, br tags, all sorts of unsemantic rubbish!
darasd
A: 

You have an information that needs to be displayed in two dimensions (rows,columns), with each dimension describing something about the data (i.e. data number (row) and info (col)).

It sounds like a table to me, and also sounds like it would be better treated as such from an accessibility persective! Think of screen readers that may going to have to read the info.

James Wiseman