Search code examples
htmlsemantic-markupsemanticshtml-tablehtml-lists

Which html element is semantically most appropriate for displaying a group of emails?


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.


Solution

  • 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?)