@ray326Dec 17.2004 — #I think the general concensus has been that you could think of label=th and input=td so a table would have valid syntax. Lately I've been using a <div><label><input></div> sort of pattern to do it sans tables.
@NogDogDec 17.2004 — #I am not claiming this is [i]the[/i] way to do it, but I was playing around with how to line up form elements without using tables and came up with this: <i> </i><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang='en'> <head> <META HTTP-EQUIV='Content-Type' CONTENT='text/html; charset=ISO-8859-1'> <title>Form</title> <style type="text/css"> label { display: block; float: left; clear: left; width: 8em; } p.form { margin: 2px; padding: 2px; } div.form { margin: 1em auto; clear: both; background-color: silver; border: solid navy 2px; padding: 1em; width: 35em; } h1 { text-align: center; } </style> </head> <body> <h1>A Form</h1> <div class=form> <form id="form" action="?" method="post"> <p class=form> <label for="field1">This is a test:</label> <input id="field1" type="text" size=20 maxlength=40> </p> <p class=form> <label for="field2">Test2:</label> <input id="field2" type="text" size=20 maxlength=40> </p> <p class=form> <label for"select">My Select List:</label> <select id="select"> <option>one</option> <option>two</option> <option>three</option> </select> </p> <p class=form> <label for="area">Text Area:</label> <textarea id="area" cols=40 rows=10>This is a test.</textarea> </p> </form> </div> </body> </html>
In their sample, a div is being used for each row. In your guys' examples, a paragraph is being used. Would a paragraph work better than a div? Or the other way around?
I'm thinking this would just be someone's preference...
@David_HarrisonDec 17.2004 — #Someone else had this idea and wrote a blog about it. Personally I wouldn't use tables, but Jona put forward quite a convincing [url=http://www.cmmwebdesign.com/blog/chronicles/2004/12/12/displaying-your-forms]arguement[/url] for tables.
@porcoDec 18.2004 — #Or lists could be just as valid... but there's jags of stuff on a google search on making forms display without tables. I think one of the things that can be a drag though is that form elements are actually tied to the OS re display.... Still I use lists quite happily....