DataTable - Basic

DataTable displays data in tabular format.

IdYearBrandColor
41c110281977BMWBlack
836aa9ea1972MercedesGreen
b7fc39e21991JaguarOrange
af9dbb381990RenaultWhite
95c17a6d1989RenaultWhite
48c500271985FordYellow
35a0edfa1982RenaultMaroon
2ed1c6a32008RenaultRed
f862be0f1997FiatWhite
7e3e62421980MercedesBlack
<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>