DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
3439e3ca2004HondaRed
8af1eeb41998VolkswagenWhite
95d152421977HondaBlue
602cddd61992AudiBlue
ca1a7f711980VolkswagenBrown
55cfe9b71962VolkswagenOrange
054b39ff2000FiatYellow
63c933a51962VolvoSilver
328adde61997FiatWhite
a654c2b11980VolkswagenBlue
<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.