h:panelGrid

HtmlPanelGrid is a UIPanel component that renders a <table> element to layout its children in a tabular grid.

General Usage

The columns attribute specifies how many table columns are rendered. A new table row will be rendered if the number of children exceeds the number of columns.
Row 1 Col 1 Row 1 Col 2 Row 1 Col 3
Row 2 Col 1 Row 2 Col 2 Row 2 Col 3
Row 3 Col 1

Source Code

  1. <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
  2. xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
  3.  
  4. <h:form>
  5. <h:panelGrid border="1" columns="3" >
  6. <h:outputText value="Row 1 Col 1" />
  7. <h:outputText value="Row 1 Col 2" />
  8. <h:outputText value="Row 1 Col 3" />
  9. <h:outputText value="Row 2 Col 1" />
  10. <h:outputText value="Row 2 Col 2" />
  11. <h:outputText value="Row 2 Col 3" />
  12. <h:outputText value="Row 3 Col 1" />
  13. </h:panelGrid>
  14. </h:form>
  15.  
  16. </ui:composition>
Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20