Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataTables: TypeError: i is undefined

I have a table like the following Table

the table as rowspans because for some users I need to have 2 lines (Like you see at column 'D')

I am trying to use datatables:

<table class="table table-bordered table-hover table-striped" id="myTable">
(...)
</table>

And I call this at the begining of the code:

 <script>
    $( document ).ready(function() {
         $('#myTable').DataTable();
    });
</script>

But I have this error:

TypeError: i is undefined

And the table is not like a datatable type!

Maybe it doesn't work with rowspans? Any idea??

like image 978
Erbi Silva Avatar asked Nov 23 '16 15:11

Erbi Silva


Video Answer


1 Answers

FWIW you can also get this error if you don't have the same number of <td></td> elements in every row. Make sure you aren't adding any rows with nav buttons or links or anything like that that may not be formatted the same way as the other rows.

like image 181
Dylan Smith Avatar answered Sep 18 '22 13:09

Dylan Smith