Hello,
in primefaces Datatable showcases, there is an example on conditional coloring.
I am looking for something differnet: Is anybody aware of any mean to have two alternate colors, i.e. line N is white, and line N+1 is grey ?
Thanks
Alternate colors in Datatable
-
- Posts: 29
- Joined: 14 Feb 2011, 12:39
I would be interested int that too, if there is a way not using css. So just primefaces tools
-
- Posts: 23
- Joined: 18 Mar 2011, 03:49
Just override Primefaces default stylesheet classes, as in:
.ui-datatable-odd { background:#f0f0f0; } // light silver
.ui-datatable-even { background:#ffffff; } // white
You can find other stylesheet classes by opening the primefaces-2.2.1.jar with 7zip or Winrar and drill down to the \META-INF\resources\primefaces directory. You will find there a list of all Primefaces' components. Select the component you want (e.g. datatable) and look inside its accompanying stylesheet(s) (e.g. datatable.css). You will find the class names inside the stylesheet(s) so just override a class name in your own stylesheet like the examples above. Then you're good to go!
.ui-datatable-odd { background:#f0f0f0; } // light silver
.ui-datatable-even { background:#ffffff; } // white
You can find other stylesheet classes by opening the primefaces-2.2.1.jar with 7zip or Winrar and drill down to the \META-INF\resources\primefaces directory. You will find there a list of all Primefaces' components. Select the component you want (e.g. datatable) and look inside its accompanying stylesheet(s) (e.g. datatable.css). You will find the class names inside the stylesheet(s) so just override a class name in your own stylesheet like the examples above. Then you're good to go!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 69 guests