14.7. Tables

14.7. Tables

Table structures can be created using the p:table and p:cell tags. Unlike many table structures, there is no explicit row declaration. If a table has 3 columns, then every 3 cells will automatically form a row. Header and footer rows can be declared, and the headers and footers will be repeated in the event a table structure spans multiple pages.

<p:document xmlns:p="http://jboss.com/products/seam/pdf"   
            xmlns:ui="http://java.sun.com/jsf/facelets"
            title="Hello">   
   <p:table columns="3" headerRows="1">
      <p:cell>name</p:cell>
      <p:cell>owner</p:cell>
      <p:cell>size</p:cell>
      <ui:repeat value="#{documents}" var="doc">
         <p:cell>#{doc.name}</p:cell>
         <p:cell>#{doc.user.name}</p:cell>
         <p:cell>#{doc.size}</p:cell>
      </ui:repeat>
   </p:table>
</p:document>