DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
4e380db92006VolkswagenYellow
a3e8a25e1984RenaultWhite
caeacfb71966VolkswagenGreen
554071481990FiatBlue
182a43ee2009VolvoRed
51a899831994RenaultGreen
0a73acb91974BMWMaroon
928c2eb31995VolvoGreen
9444d7b71985HondaMaroon
16c209182006RenaultYellow
<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.