1 Reply Latest reply on Jul 13, 2012 2:15 PM by s.santilli

    [SOLVED] Change every second row background-color: dataTable

    s.santilli Newbie

      Hi Community,

       

      I'm relatively new to RIchfaces, but does anyone know how to change the background

      color of every second row in a richfaces rich:dataTable?

       

      I would effectively like each odd row to be white (background) and every even to

      be grey (background).

       

      Any help would be greatky appreciated

      Thanks

        • 1. Re: Change every second row background-color: dataTable
          s.santilli Newbie

          Hi Everyone,

           

          I was able to solve my own problem.

           

          <style type="text/css">

          .odd

          {

          background-color: grey;

          }

           

          .even

          {

            background-color: white;

          }

          </style>

           

          <rich:dataTable rowClasses="odd,even">

           

             <rich:column>  ... </rich:column>

           

          </rich:dataTable>

           

          Please note the rowClasses="odd,even". I apologize this was rather trivial, but at least I solved it

          on my own. Hopefully this will prove useful to someone else.

           

          I will close this post marking the title [SOLVED]

          Thanks