tags:

views:

49

answers:

3

Hi,

what it better practices for creating web forms, using tables or lists ?

Regards

Javi

+4  A: 

Neither.

A form is just a form. It might consist of paragraphs, simple blocks (divs), or something else.

Sometimes that forms are tabular or lists, but not often.

David Dorward
+2  A: 

There is no such a rule :-) You should use tables for tabular content, you shouldn't use it for you page layout since it's a bad html practice.

You'll find a lot about it on google. Tables vs DIV

Claudio Redi
+1  A: 

It depends on your context. If we're speaking about web forms with labels and input fields, then having a structure using divs is most comfortable for a concept of composition

<div>
   <label... for="..">
   <input type="text"...>
</div>

<subcontrol...>

<div>
   <label... for="..">
   <input type="text"...>
</div>

This is then properly formatted by using CSS s.t. the things are well aligned in the form

Label:         input field
Label2:        input field

Composition therefore because as you see in the "HTML" above "subcontrol" may be an arbitrary reference to a control containing again the same div structure and the finally produced page would just look nicely.

The same may apply to tables, but the concept of composition already gets messier since you get nested tables as the result. Moreover some screenreaders often have problems with those nested tables (as many argue, have never tried it though).

Conclusion: It really depends on how you're accustomed to it. Personally I prefer divs and CSS because you can control it better once you have defined your overall layout.

Juri