开发者

What is the best practice for html form development?

开发者 https://www.devze.com 2023-02-04 17:02 出处:网络
I have been using the P tag for each html form filed element row but i开发者_JAVA技巧n twitter and facebook they use table for designing a form and linkedin uses ol tags for each html field rows. Ebay

I have been using the P tag for each html form filed element row but i开发者_JAVA技巧n 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.


Whatever technique you use, make sure you are 100% compliant with a tool like this.


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


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!


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号