How Can I Use Tables To Structure Forms

  • 18 Dec, 2011

    Small forms are sometimes placed within a TD element within a table. This can be a useful for positioning a form relative to other content, but it doesn't help position the form-related elements relative to each other.To position form-related elements relative to each other, the entire table must be within the form. You cannot start a form in one TH or TD element and end in another. You cannot place the form within the table without placing it inside a TH or TD element. You can put the table inside the form, and then use the table to position the INPUT, TEXTAREA, SELECT, and other form-related elements, as shown in the following example.<FORM ACTION="[URL]"> <TABLE BORDER="0"> <TR> <TH>Account:</TH> <TD><INPUT TYPE="text" NAME="account"></TD> </TR> <TR> <TH>Password:</TH> <TD><INPUT TYPE="password" NAME="password"></TD> </TR> <TR> <TD> </TD> <TD><INPUT TYPE="submit" NAME="Log On"></TD> </TR> </TABLE></FORM>

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 All rights reserved.