DataTable - Color Certain rows can be styled based on a condition using rowStyleClass. Table below highlights cars that are manufactured before 1990.
IdYearBrandColor
c742b0b32003RenaultBrown
168e647f1973HondaRed
0821328c1968MercedesBrown
7d0f76261998HondaBlue
fc8aba311966BMWOrange
1c8f79bb1999FiatWhite
5499c90e1974VolvoYellow
4e2fd97e1982VolvoBlack
6c763f1e1973VolkswagenBlue
950416022006RenaultYellow
<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 © 2015
All rights reserved.
Running PrimeFaces-6.1-SNAPSHOT on Mojarra-2.2.8.