DataTable - Header and Footer

Header and Footer section are defined using facets.

List of Cars
IdYearBrandColor
388149f22002HondaBlue
043de8c12008VolvoBlack
55e0e1711996RenaultOrange
611973d52008AudiOrange
1d1128981982FordSilver
1eb6d5e31999BMWBlue
30e52d631992RenaultOrange
2f1535351971RenaultSilver
53f7580e1982RenaultMaroon
4342fbf72005AudiMaroon
<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>