Lara Lara - 3 months ago 23
CSS Question

How to change the jquery datatable Column color

I am creating and populating jquery Datatable dynamically without prior declaring column and rows from the values received from ajax call.Now I want to change my Datatable column header color. Below is the markup of my table.

<div class="row" style="padding-top: 2em;">
<div class="col-sm-12">
<div class="row" style="padding-top: 2em;">
<div class="col-sm-12">
<table id="adt" class="table table-bordered table-hover compact table-striped" cellspacing="0" style="width: 100%">
</table>
</div>
</div>
</div>


How to update the coloum color in this case? Please help

Answer

You can use simple css for that like:

#adt > thead > tr > th {
    background-color: gray !important;
    color: white !important;
}
Comments