1

I would like to create a form to fill up customer information. I use asp.net master and content pages. It contains only simple controls such as label and text box. Which container should I use here.

  1. table (I heard table are very slow)
  2. div(use css to act as a table)
  3. use ul and li

Which one is good here and why ? Could you please suggest a control which is not listed above :)

Rauf
  • 12,326
  • 20
  • 77
  • 126
  • 1
    http://stackoverflow.com/questions/83073/why-not-use-tables-for-layout-in-html This might have your answer. – TIHan Sep 09 '11 at 18:33
  • That depends greatly on how you want the display to look. Tables are slow to render, but for your sake the difference is probably negligible. – James Johnson Sep 09 '11 at 18:49

3 Answers3

3

I am voting for ul and li over divs (and definately over tables)...

Divs are more efficient than tables, but you can't nest divs inside of certain elements (and remain complient). But ul's and li's are meant for this and can usually be nested with no compliance issues. You also can use a nice thin asp.net repeater to create your ul/li structure and it should run much faster than the datagrid/table rendering.

Rikon
  • 2,688
  • 3
  • 22
  • 32
1

I used to use tables but have since moved to DIVs. When working with designers, it is much easier (at least in my experience) that designers like to write their CSS for DIVs and not tables. Divs also provide longevity to the HTML by making it easier to rearrange things in the future.

Josh
  • 10,352
  • 12
  • 58
  • 109
1

In addition to the layout, you may want to use the FormView or DetailsView controls. They support two-way data binding and changes from View to Insert to Edit modes.

John Saunders
  • 160,644
  • 26
  • 247
  • 397