DataTable - Basic

DataTable displays data in tabular format.

IdYearBrandColor
eba0e8522006RenaultSilver
6369e66f1988HondaGreen
9af76cad1994VolkswagenGreen
73b0fcb41978RenaultBlack
4f1c17c81961VolkswagenMaroon
1dfbd8221996BMWRed
6c6fd3631970FordOrange
183050cc2001VolkswagenYellow
980a304b2004FordBlue
5d0ea9241960AudiBrown
<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>