Feed Sign in with OpenID OpenID

Simon Willison’s Weblog

“Interactive Tabular Data”

Just spotted in a comment by Drew McLellan on Russell Beattie’s Notebook:

I’m comfortable using tables for forms. My point of view is that they are interactive tabular data.

I’d never thought of them like that before, but that view point certainly makes a lot of sense.

I recently contributed my own opinion on trying to create “semantic” forms to an interesting discussion on SimpleBits:

... When an HTML page incorporates forms it starts to move away from being a “structural document” and towards being a “logical interface” instead—once I start working with forms I switch my focus from semantics to accessibility and usability. Since these share many of the same requriements as semantics (use proper header tags etc) I don’t feel too guilty about using divs instead of paragraphs.

This is “Interactive Tabular Data” by Simon Willison, posted on 20th September 2003.

View blog reactions

Next: Battling comment spam

Previous: Auto-complete text boxes

5 comments

  1. As a thought experiment, imagine you wanted to display a list of attributes and values for the canonical example of a small business's employee list. It might make sense to use a definition list, dt=FirstName, dd=Bob, and so on.

    Then imagine you were going to display several records. FirstName: Bob, Joe, Pete. These guys are employees #1, 2 and 3. In this case, a definition list would be too ambiguous because there is no order to the dd's, and having dd=Bob, dd=Joe, dd=Pete, would not meaningfully/semantically match up to their last names in the dt=LastName unit of the definition list--definition lists do not imply a relationship between the definitions of a first term and those of a second term; in fact, a one-to-one mapping is not even required. The first DT could have two DDs, while the second could have three.

    Putting these records into a table, though, would give it the structure that best gives meaning this kind of data. The rows make sense, the columns match, and the match of each FirstName with its corresponding LastName would be made clear by markup and display.

    Taking this backwards, it could be easily argued that a single record would be just as well in tabular form.

    Now imagine a form as a table of data, but with the data not yet filled in. I like how Drew calls it "interactive tabular data." If the form fields were replaced with data, a tabular layout would just make sense.

    Upon previewing this comment, I guess this was a really long way of saying that form input which will go into a database is naturally tabular data.

    Micah - 20th September 2003 05:48 - #

  2. Talking of DL definition lists, if one does decide that tables are not the way to go for forms, then perhaps a definition list might be good way if semantically joining label to form control. At least better than divs or paragraphs.

    Rich - 23rd September 2003 10:22 - #

  3. Let's be honest, you're just trying to get out of using awkward css ;) 'An orderly arrangement of data, especially one in which the data are arranged in columns and rows in an essentially rectangular form.' Being serious though, I think that you'd class a form as almost tabular, but not quite. There's probably not going to be any data in it before you start filling it in. Think about your data. HTML3.0 - Why can't we all just get along?

    John Hunt - 26th September 2003 09:12 - #

  4. perhaps a definition list might be good way if semantically joining label to form control.

    No, that's what the <label> element is for. I dislike the idea of using "Definition Lists" for anything other than lists of definitions. In particular, labels aren't terms that are being defined.

    Jim Dabell - 29th September 2003 00:37 - #

  5. IMHO, a form is a "list" of field to fill. which in my opinion have to be formulated in such syntaxe. well, ordered or not, I really don't know but I often make my forms usings lists of labels and fields.

    karim - 13th February 2005 12:33 - #

Comments are closed.

Previously hosted at http://simon.incutio.com/archive/2003/09/20/interactiveTabularData

A django site