DataTable - Basic

DataTable displays data in tabular format.

IdYearBrandColor
56832f861998VolkswagenSilver
9cac1fc21964FordBlack
61acc5051963FordYellow
e90325641964VolkswagenMaroon
a4984b351988VolvoBrown
dda638d41979MercedesWhite
7fbb93561981VolkswagenBrown
2542698d1972BMWGreen
fcfaae211969BMWWhite
a43af7e81962VolvoMaroon
<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>