DataTable - Header and Footer

Header and Footer section are defined using facets.

List of Cars
IdYearBrandColor
42558dbf1983JaguarYellow
3f6230f21970VolvoBrown
38e9e00c2003VolvoYellow
4177a6161964FiatBrown
091000411997MercedesYellow
27d4acbf1994MercedesOrange
a70a583d1999MercedesMaroon
24936b1f1964RenaultBlack
8692eca92006MercedesOrange
c153b0aa1962FordMaroon
<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>