DataTable - Header and Footer

Header and Footer section are defined using facets.

Documentation
List of Cars
IdYearBrandColor
17aedb6b1983RenaultGreen
a7eff40a2008AudiBrown
10683c871969JaguarBlue
a409821f1985BMWSilver
62368b5a1962BMWRed
71551f1c1968VolkswagenBlue
e3acd30f1983RenaultGreen
b58747321986JaguarMaroon
01c47b5d1967BMWGreen
c99b4e9b1972MercedesBrown
<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.