How to loop on each td using createdRow?
How to loop on each td using createdRow?
![ziv@kpmbro.com](https://secure.gravatar.com/avatar/bb96751351d8c7bcde8640bacc31e97f/?default=https%3A%2F%2Fvanillicon.com%2Fbb96751351d8c7bcde8640bacc31e97f_200.png&rating=g&size=120)
in General
Hello
I want to change the td color base on his value, so i am looping on the rows using createdRow, but it gives me the data for each row, how can i loop on that data(td's)?
i need something like this:
"createdRow": function( row, data, dataIndex ) {
if ( data.every().cell() == "TRUE" ) {
$(cell).addClass( 'green' );
}else
{
$(cell).addClass( 'red' );
}
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
found it
Or use
$('td', row).addClass(...)
increatedRow
.Allan
Thanks Allan![:) :)](https://datatables.net/forums/resources/emoji/smile.png)