0

I Am from a WPF/XAML background and I'm trying to get my head into MVC. I am wondering if I want to create a data capture form, would you use table or div to structure the labels and dropdowns/textboxes etc.?

I ask because the template provided has all stacked one on top of another and wastes valuable screen area. I want to have my labels for Title, Forename, Surname all on one line/row and the same for data capture elements?

2 Answers 2

1

You should use div to structure your layout. Also you can use some grid layout framework (like in Twiter Boostrap, see Grid system). If you have WPF background - it can simulate to some extent Grid panel from WPF in HTML world.

0

In HTML table tags should be used for Tabular data; layout of forms etc should be done using Div / Span tags for structure and CSS to control the structure.

Take a looks at the link below for input form structure example:

Differents way to structure html inputs and labels in a form

Best way to structure a two column html form?

http://aceinfowayindia.com/blog/2009/06/how-create-good-looking-form-without-table/

It's not only cleaner to use Div, but it also makes the page more accessible according to W3C rules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.