DataTable - Header and Footer

Header and Footer section are defined using facets.

Documentation
List of Cars
IdYearBrandColor
381adeca1964MercedesBlue
7cb61aea2005VolkswagenYellow
f1aad1222006AudiWhite
085c88851978BMWRed
5171c4f62007BMWOrange
ef839d851978VolvoYellow
2325db041983JaguarBlack
fd29e3881995RenaultBlack
db6c366c1998HondaGreen
2efe04c02009FiatGreen
<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.