FixedColumns row class ignored
FixedColumns row class ignored
edwardiv1
Posts: 13Questions: 3Answers: 0
When using FixedColumns and specifying the first 2 rows as fixed, the row class is not applied to the fixed columns.
fixedColumns: {
left: 2
},
fixedHeader: {
header: true,
},
scrollCollapse: true,
scrollX: true,
...
<tr class="danger"><td>...</td></tr>
The "danger" class is applied to the entire row, except for the columns that are fixed.
This question has an accepted answers - jump to answer
Answers
Hi,
We need to assign a background colour to the fixed cells, otherwise they might be transparent, and it looks horrible! As such, any assignment you make to override that colour needs to have a higher priority in CSS -
!important
might help in this case: https://live.datatables.net/gehihuge/1/edit .Allan
Hi Allan,
Thanks for explaining.
Not sure how practical it is for me to add
!important
- the classes are defined in standard Bootstrap CSS - https://getbootstrap.com/docs/3.4/css/#tables-contextual-classesIt's not a huge priority, but would certainly make it look much better if it could be addressed.
I'm not sure I can address it. The CSS stylings for the background colour you want need to be made more specific to override the FixedColumns ones, which have to be there as explained.
What class is it you are adding? Perhaps you just need to create a custom style with that colour and make it a higher priority.
Allan
Yes, I see what you mean now about the transparent background and display issues.
I wonder if it's possible to add the white background in the fixed columns only if an existing background color is not already set - perhaps using javascript to check the cell style.
I'm not actually sure if that is possible. I suspect it would also be slow since it might need to query each cell, since a background might be assigned to some cells and not others.
It would be much easier to just add the following to your site's CSS:
Allan
Thanks, Allan. Great product by the way!
Thank you