DataTable - Header and Footer Header and Footer section are defined using facets.
List of Cars
IdYearBrandColor
d41b5c831990VolkswagenSilver
1807de381982AudiBlack
56d5a0201995RenaultBrown
6920904c1987JaguarBlack
aa43f7fb1975FordSilver
42e9a8b41971FordBrown
688021101964HondaBrown
93fe08b21968AudiBrown
13ec33741996MercedesSilver
efdfc52f2008BMWYellow
<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.1.4 on Mojarra-2.2.10.