I'm using DataTables in my app and it works great. To center the text, I'm using:
{ className: 'dt-center', targets: '_all' },
However, for the last column, I want to align the text left instead of center, but the following is having no effect:
{ targets: [ 12 ], className: 'dt-left' }
Here is my complete code:
$('#audits-datatable').DataTable({
columnDefs: [
{ width: '70px', targets: [ 0, 1, 11 ] },
{ width: '125px', targets: [ 8 ] },
{ width: '600px', targets: [ 12 ] },
{ className: 'dt-center', targets: '_all' },
{ targets: [ 12 ], className: 'dt-left' }
],
});
Why is "dt-left" not overriding "dt-center" in column 12? It still shows up aligned centered instead of left.