Mirage LIVE PREVIEW

DataTable - Header and Footer

Header and Footer section are defined using facets.

Documentation
List of Cars
IdYearBrandColor
1befb93f1983VolkswagenOrange
9b3f52eb2002FordBrown
2bdcb0022004HondaOrange
e8e2a0111973FordOrange
3d95244a1988AudiWhite
0fba3a641961RenaultRed
f81fe7301969VolvoOrange
30d1e94b1964RenaultGreen
a5ae1ec31996JaguarSilver
efda90c61970MercedesBrown
<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>