Divs vs. Tables for Forms

Out of context: Reply #11

  • Started
  • Last post
  • 19 Responses
  • Continuity0

    Honestly, I'd got with divs for this, SJ. Yes, the forms are complex, but if for any reason you need to edit this form later on, you'll be happy that you didn't go the table route.

    If I was doing this, I would set it up within a container div for the whole form, making it easier to manipulate the whole thing overall.

    After that I would probably set the display properties to table-row for each row of form content, and put each element – whether it's a label or a form element – in its own div, and style that in the external CSS.

    Yeah, it's a lot of nested divs, but the primary advantage here is that you can them go on to style the actual form elements (which, as inteliboy mentioned, are notorious frustrating to style) without _necessarily_ breaking the rest of the layout.

    Best thing to do is a quick sketch on paper with divs marked out as boxes so that you can better plan your mark-up when you first set it up, and can then figure out your floats, as well.

View thread