Best practice for making web forms
forms, html
Solution
Don't use tables, that's a very brittle, non-semantic layout, use proper CSS layout. Below are some presentations that explain some good approaches to form layout, including usability considerations. The first link is more about the code, and the second more about design and usability considerations:
- Learning To Love Forms (Web Directions South '07)
- Best Practices for Form Design
Problem
Is it ok to use tables to make web forms or should I use div's? I know how to use tables, but how should I make form with div's or is it better to use tables? ``` <form method="post"> <table> <tr> <td> <label for="username">Username:</label> </td> <td> <input type="text" name="username" id="username"/> </td> </tr> <tr> <td> <label for="password">Password:</label> </td> <td> <input type="password" name="password" id="password"/> </td> </tr> <tr> <td> <input type="submit" name="cancel" value="Cancel"/> </td> <td> <input type="submit" name="send" value="Send"/> </td> </tr> </table> </form> ``` Possible Duplicate: Why-not-use-tables-for-layout-in-html