Change Color only in the first cell of a table
Change Color only in the first cell of a table
JochenK
Posts: 47Questions: 7Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
Answers
Hi Colin,
I have a table with fixedColumns ( the first cell ) defined. How i can change the color only for this fixed cell?
Thanks for your help.
using bootstrap class bg-danger. Just apply any CSS you like.
https://datatables.net/reference/option/rowCallback
no..it doesn't work ...
my code is:
This example should help - it's conditionally changing the colour but it should get you rolling,
Colin
Is this what you are looking for?
http://live.datatables.net/qovojoni/1/edit
You can use the browser's inspect tool to inspect the first cell to learn the selector used for Datatables cells. The selector might be different with different styling frameworks or configuration options.
Kevin
I tried the code snippet, Colins tip, but that didn't work either, the color didn't change. This prompted me to check the css-code closely and I found in my custom-css:
*----------------------------------------------------
thead th,
tr.odd td {
background-color: #E6E6E6 !important;
}
tr.even td {
background-color: #fff !important;
}
*----------------------------------------------------
I think part of a previous cloudtables version. I removed that part and it works!
Thanks to everyone who thought about this problem
Jochen