DataTable - Color Certain rows can be styled based on a condition using rowStyleClass. Table below highlights cars that are manufactured before 1990.
IdYearBrandColor
3fc43ab02008HondaOrange
631723952000VolkswagenBlack
04291cf22001AudiWhite
bc0c18721960VolkswagenBrown
6d55a9391979AudiBlue
5f05237a1969VolvoBlack
e6c2ff591974FiatMaroon
ecf112291963HondaSilver
089902281996VolvoYellow
fea4a6e41980VolvoMaroon
<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.3-SNAPSHOT on Mojarra-2.3.2.