DataTable - Header and Footer

Header and Footer section are defined using facets.

Documentation
List of Cars
IdYearBrandColor
9aed68cc2007HondaYellow
bb7e163c1992VolvoBlue
8c029cc31967VolvoBrown
09cd24441978VolkswagenBlack
13266f662005BMWBlack
331cfe201977VolkswagenBrown
29e30f7b1996FordMaroon
9498f23d1986AudiBlue
ef6ae32a1976BMWYellow
86742f4c1974RenaultWhite
<p:dataTable var="car" value="#{dtBasicView.cars}">
    <f:facet name="header">
        List of Cars
    </f:facet>
    
    <p:column headerText="Id">
        <h:outputText value="#{car.id}" />
    </p:column>

    <p:column headerText="Year">
        <h:outputText value="#{car.year}" />
    </p:column>

    <p:column headerText="Brand">
        <h:outputText value="#{car.brand}" />
    </p:column>

    <p:column headerText="Color">
        <h:outputText value="#{car.color}" />
    </p:column>
    
    <f:facet name="footer">
        In total there are #{fn:length(dtBasicView.cars)} cars.
    </f:facet>
</p:dataTable>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.