Hello, I need to create a table in ODC with the color of the row that alternate between white and gray, I know that is a CSS thing, but i can't find the proper one.Thank you for your help.
-Gabriele
Hi @Gabriele Pastore
below I mention the CSS code you need to put it in screen style sheet , then you need to use the following statement
>> If(Mod(GetEmployees.List.CurrentRowNumber, 2) = 0, "even-row", "odd-row")
in the style classes for every row cell you want to apply that condition.
Note:
GetEmployees.List.CurrentRow Number is the aggregate name linked to your table
CSS Code:
-------------------------------------------------------------------------------------
.table tr:nth-child(even) {
background-color: #b1d7fd; /* light gray */
}
.even-row, .odd-row {
background-color: inherit !important;
table tr:hover {
background-color: #f39387 !important; /* Light blue on hover */
-------------------------------------------------------------------------------
It worked, thank you for your help!-Gabriele
Welcome!
Hi Gabriele,
Would you like the row colors to change based on a condition, or should the table simply alternate colors between odd and even rows?
Hi Mihai,
just for odd and even rows.
You can either use:
.table-row:nth-child(odd) td {
background: grey;
or
.table-row:nth-child(even) td {
You can use this CSS for Even:
.table-row:nth-child(even) td{
background-color: #f2f2f2;
and for odd:
.table-row:nth-child(odd) td{
I hope this helps
Thanks
Hi Gabriele, you can apply this css. or style
.ListRecords div:nth-child(odd) { background-color : aliceblue;}.ListRecords div:nth-child(even) { background-color : cornsilk;}or