DataTable - Basic

DataTable displays data in tabular format.

IdYearBrandColor
9667c3791977MercedesSilver
aefc33ff1965VolkswagenBlue
db5dc7811966FordBlue
aee537371997AudiOrange
6e12b1c51995VolvoOrange
32eba9201997RenaultBlack
4bf317e31964FiatBrown
1ceae3a72003FordMaroon
c3f98a5b1965RenaultYellow
73786ffd1973AudiGreen
<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>