I have a problem hiding a jQuery datatable column. I want this column to retrieve data, but I do not want it to appear on the display page. I want to hide my column number 8, so from CSS I tried to hide it and it gives me a resettable div.

Below my code for the data table and the class to hide is "hideCol".
var userTable = $('#user').dataTable( { "processing": true, "serverSide": true, "ajax":"admin/getData.php", "responsive" : true, "lengthMenu": [10, 25], "paginationType" : "input", columns: [ { data:'param0'}, { data: 'param1' }, { data: 'param2' }, { data: 'param3' }, { data: 'param4' }, { data: 'param5' }, { data: 'param6' }, { data: 'param7'}, ], fnRowCallback:function(nRow,aData, iDisplayIndex, iDisplayIndexFull){ var seenReportedVal =Number($('td:eq(7)', nRow).text()); $('td:eq(7)', nRow).addClass('hideCol'); if(seenReportedVal==0) { $(nRow).addClass('bold'); } }, "columnDefs": [ { "visible": false, "targets": 7 } ], });
source share