One can layout JSF pages using HTML tables, but it is tedious.
JSF provides the
h:panelGrid and
h:panelGroup tags to
alleviate some of the tedium.
Their use is briefly described here.
See tables 4-8 and 4-9 on pp. 116-118 for a listing of the available attributes
for these tags.
See
Example Applications for
examples of applications that use them.
You can lay out components in a grid of rows and columns by using
the
h:panelGrid tag with the
columns attribute, like this:
<h:panelGrid columns="3">
...
</h:panelGrid>
Components are laid out in columns from left to right and top to
bottom, in the order they appear in the body of the tag.
h:panelGrid is often used with
h:panelGroup, which groups
two or more components so they are treated as one.
For example, you might group an input field and its
error message, like this:
<h:panelGrid columns="2">
...
<h:panelGroup>
<h:inputText id="name" value="#{user.name}">
<h:message for="name"/>
</h:panelGroup>
...
</h:panelGrid>
Grouping the text field and error message puts them in the same table cell.