0
<table></table>

<script>

$(function () {
    $('table').each(function () {
        $(this).DataTable(
               {

                   stateSave: true,
                   "sDom": 'C<"clear">rfrtip',
                   "scrollCollapse": true,
                   "paging": true,
                   responsive: true
            });

    });

});

Occurring error:

 Uncaught TypeError: Cannot read property 'aDataSort' of undefined<br/>
         at _fnSortFlatten (jquery.dataTables.js:5889)<br/>
         at _fnSortingClasses (jquery.dataTables.js:6227)<br/>
         at loadedInit (jquery.dataTables.js:1234)<br/>
         at loaded (jquery.dataTables.js:6341)<br/>
         at _fnLoadState (jquery.dataTables.js:6425)<br/>
         at HTMLTableElement.<anonymous> (jquery.dataTables.js:1329)<br/>
         at Function.each (jquery.min.js:2)<br/>
         at w.fn.init.each (jquery.min.js:2)<br/>
         at w.fn.init.DataTable [as dataTable] (jquery.dataTables.js:869)<br/>
         at w.fn.init.$.fn.DataTable (jquery.dataTables.js:15172)

I also tried

<table><thead></thead><tbody></tbody></table>

EDIT : How to fix this without filling thead?

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.