HTML and CSS Reference
In-Depth Information
17.3.3. Better Forms Layout
Of all the features in HTML and XHTML, forms cry out for better
layout control. Unlike other structured elements, forms look best when
rendered in a fixed layout with precise margins and vertical alignment of
elements. However, except for carefully planned, <pre> -formatted form
segments, the standards just don't give us any special tools to better
control forms layout. You can accomplish a lot with stylesheets, but that
gets complicated quickly. Instead, tables provide easy forms layout. Basic forms layout
Your forms almost always look better and are easier for your readers
to follow if you use a table to structure and align the elements. For ex-
ample, you might use a vertical alignment to your forms, with field la-
bels to the left and their respective form elements aligned to an adja-
cent vertical margin on the right. Don't try that with just standard HTML
or XHTML. Rather, prepare a form that contains a two-column table. The
following HTML source does just that, as shown in Figure 17-4 :
Figure 17-4. Align your forms nicely with tables
Search WWH ::

Custom Search