Responsive datatable always hiding a column

Responsive datatable always hiding a column

ukuser35ukuser35 Posts: 2Questions: 1Answers: 0

I have the following code:

$(document).ready(function(){ t = $('#searchResults').DataTable({ "serverSide":true, "ajax":"http://localhost/licensingworld/htdocs/index.php/portal/out_data", "responsive":true, "dom":"ip>", "language":{"emptyTable":"No results were found"}, "columns":[{"data":"CompanyName"}, {"data":"CountryName"}], "columnDefs":[{responsivePriority:1,orderable:false,"targets" : [0]}, {responsivePriority:1,orderable:false,"targets" : [1]}]});;})
Company NameCountry

This runs in a bootstrap window 1170px wide and the data returned is very narrow. I'm wanting more columns than this and for some reason my other tables work fine but this one particular one auto collapses a column unless there is only 1. Has anyone else had this problem and seen it occurring?

Thanks

Antony

Answers

  • ukuser35ukuser35 Posts: 2Questions: 1Answers: 0

    I found the fix to this was add

    table.dataTable {
    width:100%!important;
    }

    To my css - if that helps!

This discussion has been closed.