tags:

views:

5045

answers:

6

I know it's bad to use HTML Tables for everything... and that tables should be used only to present tabular data and not to achieve some style goal.

My question is, how do you make HTML forms with CSS so they look nice and aligned like when using tables?

+12  A: 

http://www.quirksmode.org/css/forms.html has an example that I've adapted and used before.

KernelM
Thank you so much, this is just what I needed.
Pablo Fernandez
The link does not exist anymore. Has it moved or is the answer outdated?
Roalt
The answer if from Oct 7 2008. So yes, it is outdated. -_-
elvispt
A: 

I would lookup using the div tag to layout data on a page.

Tables are still very much useful for tabular data, but its frowned upon for laying out a page.

View source here on stackoverflow.com, there's probably some good examples.

Doug T.
hmm .... page source on SO looks to have lots of tables. :)
Carlton Jenke
A: 

Think about putting field names above the field, rather than beside. I find this works about the best.

Cory Dee
When done right, this makes forms infinitely more readable as your eyes only have to move in one direction instead of scanning back and forth.
John Sheehan
It doesn't work very well though for complex forms. For me, it just forced me to simplify the forms, which is never a bad thing.
John Sheehan
We don't always have the luxury of specifying the design, unfortunately.
Andrew Hedges
+2  A: 

Take a look at the code used in wufoo forms, they use ul's to format the forms and they look really good.

http://wufoo.com/gallery/templates/

Todd
+6  A: 

Nick Rigby wrote an excellent article for A List Apart titled Prettier Accessible Forms

Uses fieldset, legend, label. Highly semantic.

Shawn Miller