Help - Search - Members - Calendar
Full Version: Table-less forms
Weborum Webmaster Forum > Web Page Design > CSS
bassrek
With the type of work I do, a common requirement for me is to create an online form. I typically follow the standard of the field name on the left, then the associated form input element on the right, all laid out using a nifty table biggrin.gif

So I'm tring to progress my css skills and ran across this page that shows a way to accomplish the same type of layout I use without the aid of tables by applying a css-aided layout:
http://realworldstyle.com/forms.html

Below is psedocode showing basically what the page suggests compared to a basic table layout:
CODE

div container
  div row
     span cell
        *content*
     /span cell
     span cell
        *content*
     /span cell
  /div row
/div container

'as opposed to...

table
  table row
     table cell
        *content*
     /table cell
     table cell
        *content*
     /table cell
  /table row
/table


I've designed pages with tables for longer than I'd like to admit. As a result, I can decode table code in my sleep, so I tend to dismiss the argument that css-based layouts are easier to read. Plus, as you can see, there really isn't any less code; in fact, it mirrors table code pretty much exactly.

I don't know if I really have a question or not; the css code example works great to duplicate the table layout. Short of the "tables weren't meant for layout" argument, I wonder, what's the benefit of throwing a table out in this instance in favor of a css layout? I'm not questioning whether or not I should ever use a css layout instead of tables, I just want to know the opinion in this case.
leo
i still use tables for forms smile.gif

QUOTE
From article:
The trick is to create a DIV that works like the TABLE

why bother if form data is tabular data anyway wink.gif
bassrek
Heh, that's what I was thinking. Even by their own admission, this is a case where a table probably is better suited, but I guess I'm just venting at the absurdity of reinventing the wheel in this case.
Josh
Tables are meant for tabular data...and this constitutes as tabular data IMO! biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.