In my prior entry entitled Tables vs. Tables I reminded us all, myself included, that the W3C says that web authors are allowed to use HTML tables to lay out forms. This flies in the face of much conventional “wisdom” that says HTML tables are never to be used for anything. But it struck me not too long ago that forms really ARE tables that are simply waiting for some of their data to be filled in.
Allow me to illustrate. Here is a simple table that I don’t think anyone would argue really is a table:
Example #1
Table
First Name: | Donald |
Last Name: | Duck |
Address: | 1313 Duck Lane |
Occupation: | Sailor |
Girlfriend: | Daisy |
Example #2
Form
Now, what if we remove half the information, leave half the information, and wait for a user (Donald Duck, presumably) to fill in the remaining half:
Does the form then become something other than a table? To me it is still basically a table.
Example #3
Form That’s Even More Like a Table
Now, let’s look at the form with the information plugged into the blank text fields:
Doesn’t it now look almost exactly like the first example?
Post Script
Before you jump all over me please realize that I am not saying that tables should be used for page layout (yes, I do my page layouts with DIVs and CSS). But, if after what I presented you have good reason to say that a web form should not be laid out using tables please let me know by leaving a comment. I am open to all points of view.
(Also, I’m not saying that tables or forms need to be presented in such a plain fashion. I am just making things simple here for purposes of illustration. See Data Tables, Lesson #2 for some instruction on how to dress up a table, and look for more such lessons in the future.)
Update (April 23, 2013)
I should add that I recently worked on a project where this very thing needed to be done: at one point a table of data is displayed and if the user so chooses they can edit the information in the cells in the right column. Once they go from “view only” mode to “edit” mode there is no need to then present the data as anything other than a table.