DataTable - Color Certain rows can be styled based on a condition using rowStyleClass. Table below highlights cars that are manufactured before 1990.
IdYearBrandColor
2cfedf2c1992BMWWhite
e82b3e751995VolkswagenMaroon
48e5975d2001FordBrown
645e82501985JaguarYellow
a4dd08912001VolvoRed
c5b237cb1994VolkswagenBrown
3efb52591969RenaultBrown
574b71501987BMWOrange
d458018c1991VolkswagenWhite
ffa2e0cc1981VolkswagenOrange
<p:dataTable var="car" value="#{dtBasicView.cars}" rowStyleClass="#{car.year le 1990 ? 'old' : null}">
    <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>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.2-SNAPSHOT on Mojarra-2.3.2.