Change background colour of a datatable cell
Change background colour of a datatable cell
Hi
i'm using this syntax to get the cell contents:
var idrow = dTblOverview.row("#"+rowPk);
var cellContent = dTblOverview.cell( idrow, 6 ).data();
I would like to elaborate on this and change the cell (cellContent ) background colour using the same syntax as its post-datatable initialisation and being called from another part of the script.
thanks in advance ...
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @aCoradatatbl ,
If you use
node(), then you can change it easily with jQuery, something like:Cheers,
Colin
Thanks for the response Colin,
Node api? that requires editor doesn't it or am i reading wrong? Im not using editor just datatable with the buttons api - itried something similat to that syntax like:
dTblOverview.cell( 5, 6 ).css('color', 'yellow')is there a datatable function which can reference the cell object to achieve this??
thanks ...
Colin gave the wrong link, it should be
cell().node(). It is a Datatables API. Did you try Colin's suggestion?Kevin
Ahhah, Yes that worked Kevin, didn't actually try first time since it said Editor API required - thanks for the heads-up.
Cheers