DataTable - Basic

DataTable displays data in tabular format.

IdYearBrandColor
ec243d6e1989HondaSilver
afe5364d1970HondaBlue
8c6c12d81974RenaultSilver
9a0ed4fc2001VolvoSilver
9bca53b02003JaguarBlue
ecdb50fc1979JaguarGreen
5c7ab9251999FordSilver
c58314901990MercedesGreen
6bb9a7191980AudiBlack
ee712cc42009FiatOrange
<p:dataTable var="car" value="#{dtBasicView.cars}">
    <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>
</p:dataTable>