How to change font size for one particular column
How to change font size for one particular column
I am populating datatable data using ajax call. So I don't have html creating body of the table, rather its been done in datatable creation. Now I want to change the font size of only one column out of 12 columns, but it is taking default css while rendering. This is how I am populating data.
{
"data": "lseSta"
},
{
"data": null,
"render": function(data, type, full, meta) {
return data.lseTerm.toString().replace(/^0+/, '');
}
},
{
"data": null,
"render": function(data, type, full, meta) {
return data.lseEffMo.toString().replace(/^0+/, '');
}
},
{
"data": null,
"render": function(data, type, full, meta) {
if (data.mgtFeeInd == '$') {
return '$ ' + data.mgtFee;
} else {
return data.mgtFee + ' %';
}
}
This question has an accepted answers - jump to answer
Answers
https://datatables.net/reference/option/columns.className
You could add a class name to the column and change the css for that class.
live.datatables.net/rexiseva/2/edit
I put the
className
incolumnDefs
instead of yourcolumns
array, but the effect should be the same as adding it to yourcolumns
array.Thank You @JLegault . It is working as expected.