DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
1674ba921960VolvoBlue
c1bb6bf91960JaguarSilver
6a2f2c7e1967JaguarRed
07c0e1581999FordRed
893e567e1997BMWMaroon
6c8371112009AudiOrange
075da2f31968AudiBlack
da30eab11981FordGreen
c433a8351989JaguarRed
2a3eb7081973VolkswagenMaroon
<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 © 2017
All rights reserved.
Running PrimeFaces-6.3-SNAPSHOT on Mojarra-2.3.2.