I keep hearing that div tags should be used for layout purposes and not table tags. So does that also apply to form layout? I know a form layout is
I think it's a myth that forms are "difficult" to layout nicely with good HTML and CSS. The level of control that CSS gives you over your layout goes way beyond what any clunky table-based layout ever would. This isn't a new idea, as this Smashing Magazine article from way back in 2006 shows.
I tend to use variants of the following markup in my forms. I have a generic .form style in my CSS and then variants for text inputs, checkboxes, selects, textareas etc etc.
.field label {
float: left;
width: 20%;
}
.field.text input {
width: 75%;
margin-left: 2%;
padding: 3px;
}
Tables aren't evil. They are by far the best option when tabular data needs to be displayed. Forms IMHO aren't tabular data - they're forms, and CSS provides more than enough tools to layout forms however you like.