DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
bcee34dd1982FiatRed
e68792dc1999FiatGreen
19b1f8651967VolkswagenWhite
842b3e711994FiatBlack
8e67668d1977BMWSilver
163503e51979VolkswagenRed
17ba12ef1966AudiBlack
9280c3171983AudiGreen
13c84a7a1996FordSilver
fda767901994AudiYellow
<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.2.RC1 on Mojarra-2.3.2.