I want to add a class to my <td>
tags in my table. Here is my code
var dtVouchers = $('#tblVouchers').DataTable();
dtVouchers.row.add([
'<span>'+text+'</span>',
'<span>'+data._voucherCode+'</span>',
....
]).draw( true );
and here is the my result
<tr role="row" class="even">
<td class="sorting_1"><span>Valid</span></td>
<td><span>be6875f9-5af7-4</span></td>
</tr>
but I would like to haves something
<tr role="row" class="even">
<td class="vocuherrow sorting_1"><span>Valid</span></td>
<td class="vocuherrow"> <span>dd4ce858</span></td>
</tr>
I've tried "addClass" but it adds the class to my <tr>
(row) not <td>
(column)
So, my question is how to add "vocuherrow" as a classname to my each column?
Edit: I prefer the add class while I am addding rows.. not seperatetly.