Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper definition for "tabular data" in HTML

I have a pedantic argument that needs resolution.

As a proper koolaid drinker when it comes to HTML, I'm all about semantic markup. As a result, of course I hate to see tables where they don't belong. The rule of thumb for tables is that you should only use them for "tabular data", but it has come to my attention that this is a really poorly defined phrase. I wanted to make the following data a table, but others at my office disagreed that a table would be semantically correct in this case (as opposed to a dl or ul, etc):

------------------
| SomeEmployee   |
|----------------|
| Field    | val |
| Field    | val |
| Field    | val |
| Field    | val |
------------------

Asking around the office (and the interwebs), I got some of the following answers on what makes data "tabular":

  • "Anything that you would put in a spreadsheet" (I've seen entire design mockups created in spreadsheets, so this seems somewhat lacking to me)
  • Data that would map well to a database table (e.g. row and column data, specifically)
  • "Text, preformatted text, images, links, forms, form fields, other tables, etc." (thanks W3C, that's really helpful)

And so on and so forth. None of these seem to be canonical definitions, and they don't provide great dividing lines to make decisions on. So, I ask you, my clever compatriots: how should we define tabular data.

If at all possible, please cite the sources for your answers to prevent a string of "well I think" answers.

Thanks!

Joe

like image 295
Joe Mastey Avatar asked Nov 09 '10 14:11

Joe Mastey


People also ask

What is tabular data in HTML?

Advertisements. The HTML tables allow web authors to arrange data like text, images, links, other tables, etc. into rows and columns of cells. The HTML tables are created using the <table> tag in which the <tr> tag is used to create table rows and <td> tag is used to create data cells.

How do you describe tabular data?

In statistics, tabular data refers to data that is organized in a table with rows and columns. Within the table, the rows represent observations and the columns represent attributes for those observations.

What is tabular data called?

A tabular database, as the name implies is a database that is structured in a tabular form. It arranges data elements in vertical columns and horizontal rows. Each cell is formed by the intersection of a column and row. Each row and column is uniquely numbered to make it orderly and efficient.


1 Answers

Wikipedia has some down-to-earth rules in its internal article-writing guidelines. They're far from an exhaustive definition but work well in real-world use IMO.

  • When tables are appropriate
  • When tables may not be appropriate

The whole definition is worth reading, but one paragraph strikes me as especially nice:

Before you format a list in table form, consider whether the information will be more clearly conveyed by virtue of having rows and columns. If so, then a table is probably a good choice. If there is no obvious benefit to having rows and columns, then a table is probably not the best choice.

like image 111
Pekka Avatar answered Sep 19 '22 05:09

Pekka