Below are the details of my development environment:
- Microsoft Visual Studio Professional 2013
- .NET Framework 4.0
- jQuery-2.1.4.min.js
- jQuery DataTables 1.10.7
- Newtonsoft.Json.7.0.1
- jQuery UI 1.11.2
<table class="table mb-none" id="InfoTable">
<thead>
<tr>
<th><i class="fa fa-street-view text-muted mr-sm"></i>DRIVER</th>
<th><i class="fa fa-calendar text-muted space-right"></i>DATE</th>
<th><i class="fa fa-clock-o text-muted space-right"></i>DUTY CYCLE</th>
<th><i class="fa fa-exclamation- circle text-muted space-right"></i>VIOLATIONS</th>
<th><i class="fa fa-pencil text- muted space-right"></i>SIGN</th>
<th class="center"></th>
</tr>
</thead>
<tbody>
<tr class="gradeX">
..............................................
........................................
..............................
We need to apply specific CSS stylings to certain Title Cells of columns.
var populateInfoTableJS = function () {
$('#InfoTable').DataTable({
"aoColumns": [
{ "sTitle": "LogBsonValueId" },
{ "sTitle": "UserID" },
{ "sTitle": "DRIVER" },
{ "sTitle": "DATE" },
{ "sTitle": "DUTY CYCLE" },
{ "sTitle": "VIOLATIONS" },
{ "sTitle": "SIGN" },
Can someone guide me on how to implement the code so that CSS styling is only applied to specific Title Cells of columns?
Additional question:
var populateInfoTableJS = function () {
$('#InfoTable').DataTable({
"aoColumns": [
{ "sTitle": "LogBsonValueId" },
{ "sTitle": "UserID" },
{ "sTitle": "DRIVER" },
{ "sTitle": "DATE" },
{ "sTitle": "DUTY CYCLE" },
{ "sTitle": "VIOLATIONS" },
{ "sTitle": "SIGN" },
],
"aoColumnDefs": [{ "bVisible": false, "aTargets": [0, 1] }],
"fnRowCallback": function (nRow, aData, iDisplayIndex) {
$('tr th:nth-child(1)').addClass('fa fa-street-view text-muted mr-sm');
},
......................................
................................
I tried the code provided above but it resulted in poor rendering as shown in this image: https://i.sstatic.net/NwlkG.png
Any suggestions on how I can modify the code to improve the appearance of the column headers?