Hi,
How do I make a striped table with alternating colors?
I referred above query and it’s solution, but I’m still not able to add className to the row.
Please find the code below:
TS Code:
cells: function(row, col) {
var cellProp:any = {};
if(row % 2 === 0){
cellProp.className = ‘even’;
cellProp.readOnly = true;
}
else {
cellProp.className = ‘odd’;
cellProp.readOnly = false;
}
return cellProp;
},
SCSS Code:
.odd{
background: grey !important;
color: white !important;
}
.even{
background: white !important;
color: white !important;
}
Also note that, the readOnly property is being applied to alternate rows but not the backgroundColor property.
Please help to solve this query.