DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
e44d403c1969VolkswagenSilver
26a2a72b1975FordMaroon
faca7ffc1992JaguarSilver
212abcc91983HondaGreen
b8b492892004MercedesMaroon
89d415251965FiatOrange
e927cf501981FiatBlue
4fb71a8e1983JaguarOrange
81235cf71994FordGreen
85af88bb1973FordOrange
<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.0.16 on Mojarra-2.2.8.