DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
90d392821979AudiBlue
a97c7afb1970FordWhite
f82e71fb1967BMWWhite
13bcfc5c2002HondaOrange
0870ab142008AudiOrange
3cdb4a4e1976HondaBrown
52cb0ef31986RenaultSilver
8fc632ae1981AudiOrange
b528839f1960JaguarSilver
bf1a19d51990FiatBrown
<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>
                
PrimeTek, Copyright © 2015
All rights reserved.
Running PrimeFaces-6.1-SNAPSHOT on Mojarra-2.2.8.