Formatting Forms in XHTML/CSS

This is just a quick pointer to Dan Cederholm's Simplebits weblog where he just held court on how best to format forms in your web page to be semantically correct and degradable for older browsers. I just recently ran into this and was stumped as how to best to do it without tables. How do you get the labels to line up with the fields and have it not look like complete crap when non-styled?

Well, after 50+ comments and a wrap up, it looks that for most complex forms, tables are still the way to go. It is so nice to read that. I could spend days and nights messing around trying to make my markup perfect. Having a clean resolution like this helps *a lot*. Whether forms can be semantically considered tabular data or not is questionable, but basically the other options aren't much better from a semantic sense, so there's no reason not to use the tools available to you. The mantra "tables are bad" in modern CSS-based design is definitely an extremism to get people out of their old habits which is good, but XHTML 1.1 still contains a Tabular module for a reason... Use it when you need it.

Ahhh. This bit of info will seriously allow me to sleep better at night, as insane as that sounds.


< Previous         Next >