Complex styling with columnDefs
Complex styling with columnDefs
mikeosoft
Posts: 40Questions: 14Answers: 2
Hi,
I need a way to style different columns using columnDefs.
Some columns need right alignment, and some others need a custom rendering.
Below is what I tried, but unfortunately the right alignment is not working.
Can I add multiple columnDefs like this?
"columnDefs": [{
className: "dt-right",
"targets": [ 4,5,6,7,8,9 ]
}],
"columnDefs": [{
"targets": [7,8,9,10,11,12,13],
"render": function ( data, type, row, meta ) {
return type === 'display'?
'<input type="checkbox" name="group' + meta.row + '" /> ' + data:data;
}
}]
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
No, the second will overwrite the first when initializing. Combine them into one
columnDefs
option.Kevin
Using bootstrap classes did the trick for the alignment.
Also figured out that the proper code is :
Help me please with a chekbox show into the table
I want show a checkbox in my table, from a database field of type TINY. please help me!!!