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:
|Address:||1313 Duck Lane|
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.
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?
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.