DataTable - Color Certain rows can be styled based on a condition using rowStyleClass. Table below highlights cars that are manufactured before 1990.
IdYearBrandColor
b23c6f661979JaguarBlue
3bebe9452000VolvoBrown
f22fef461994MercedesWhite
631f39d71986RenaultGreen
383e24981970JaguarWhite
dc98b7a31980FiatGreen
f3f8a3262000AudiSilver
25d3202f1981MercedesMaroon
7d6cd1a22009AudiBlack
fccf2e4f1998VolvoRed
<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.1.4 on Mojarra-2.2.10.