skip to Main Content

I have been using the P tag for each html form filed element row but in twitter and facebook they use table for designing a form and linkedin uses ol tags for each html field rows. Ebay uses div tags.

Please suggest a best practices to develop an html form.

4

Answers


  1. There is no best practice on this issue. Just use whatever feels more convenient for your current page layout.

    Login or Signup to reply.
  2. A good table-less result is a little hard to obtain (you need to know very well how positioning works, and there are several issues concerning different browsers implementations), but the code results more comprehensible and more maintainable. Moreover DOM manipulation is faster (there are tons of things to say about it… 🙂 ).
    Table layout is easier to obtain and it’s a more “natural” way to imagine columns, rows and stuff inside them.

    By the way, concerning a simple structure like a form, it really doesn’t matter what kind of technique you use!

    Login or Signup to reply.
  3. There is a huge debate / gap in opinion on this subject, whether to use tables or not? And to be frank the arguments on both sides here are compelling however the decision firmly rests with the designer / developer.

    If you use Tables then you know that as far as positioning is concerned you can control your for elements easily and indeed apply CSS to the tables if you want them to look awesome.

    If you use CSS the feeling is your more likely to have better validated code and be ‘Future Proof’ and again styling can be picked up from centralised styles such as fonts etc for your P tags.

    Personally I make the decision based on a few elements…

    1. Does CSS offer me the control I want for my form in this sites context?
    2. Can I ensure that my CSS (if used) is cross browser compatible?
      3 Do I care? Tables have been around for years so why not use them!?
    3. Do I have a specific brief asking for table-less design?

    See this article it may help Iron Spider – Tables vs CSS

    Sorry not to be more specific and good luck!

    Login or Signup to reply.
  4. Whatever technique you use, make sure you are 100% compliant with a tool like this.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search