JSF just renders basic HTML. Styling is to be done with CSS. Rightclick the page in your webbrowser and choose View Source. You'll see that the <h:panelGrid>
renders a HTML <table>
element and that those <h:dataTable>
are been rendered as a HTML <table>
element as well which in turn are nested inside the <td>
element rendered by the <h:panelGrid>
. So, you basically just want to set the vertical-align
of the <td>
of the <h:panelGrid>
to top
.
Assuming that the <h:panelGrid>
has an id
which ends up as <table id="panelGridId">
in HTML, use the following CSS:
#panelGridId>tbody>tr>td {
vertical-align: top;
}
See also:
Update: It should work. Here's a copy'n'paste'n'runnable example.
<!DOCTYPE html>
<html lang="en">
<head>
<title>SO question 3547485</title>
<style>#myid>tbody>tr>td { vertical-align: top; }</style>
</head>
<body>
<table id="myid">
<tbody>
<tr>
<td><table><tbody><tr><td>n1a</td></tr><tr><td>n1b</td></tr></tbody></table></td>
<td><table><tbody><tr><td>n2a</td></tr></tbody></table></td>
<td><table><tbody><tr><td>n3a</td></tr><tr><td>n3a</td></tr><tr><td>n3c</td></tr></tbody></table></td>
</tr>
</tbody>
</table>
</body>
</html>
All get aligned to top. Without the rule, all get centered. It's hard to tell what rule exacty you need to apply since it's unclear how your generated markup look like.