DataTable - Color Certain rows can be styled based on a condition using rowStyleClass. Table below highlights cars that are manufactured before 1990.
IdYearBrandColor
d21517c41987FiatOrange
b5a726ad1967FordOrange
90674f1d1977VolvoGreen
52c1735d1962VolvoWhite
1cf094282008JaguarRed
bff28f591972JaguarGreen
4e9383401998RenaultOrange
d457f6ae1961BMWYellow
404d6aa51982MercedesOrange
497a74ee2006VolvoMaroon
<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.