My target is right now set to column 5:
"columnDefs": [{
"render": function (data, type, row) {
return data;
},
"targets": 5
}],
What I want to do is, instead of targeting it to a specific number, I want to target it to the last column.
What I need is something like this:
"columnDefs": [{
"render": function (data, type, row) {
return data;
},
"targets": last
}],
According to the documentation you can provide an integer for the
targets
which specifies the index of the column to use.Note the second point; you can provide a negative integer to start the index from the right, so
-1
would be the last column.