Customized color on each header on Datatables
Customized color on each header on Datatables
Hi,
I want to customized the different color on each header on datatable. So I know this one which it default set whole header.
customize: function (doc, row) {
//default header color
$(doc.document.body)
.find("table thead tr th")
.addClass("header-background-color");
}
But I would like to custom the colour on specific header. as I've tried
customize: function (doc, row) {
//red header
$(doc.document.body)
.find("table thead tr th td:nth-child(0)")
.addClass("red-header-background-color");
}
But nothing working so far. Can anyone help? thanks
This question has an accepted answers - jump to answer
Answers
Unlike the column indexes, the jQuery :nth-child() selector starts at
1
not0
.Kevin