数据表:类型错误:我未定义 [英] DataTables: TypeError: i is undefined
问题描述
我有一张如下表
表格作为行跨度,因为对于某些用户我需要有 2 行(如您在D"列中看到的那样)
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>
但是我有这个错误:
类型错误:我未定义
而且表格不像数据表类型!
And the table is not like a datatable type!
也许它不适用于 rowspans?有什么想法吗??
Maybe it doesn't work with rowspans? Any idea??
推荐答案
FWIW 如果您没有相同数量的 <td></td>
每一行的元素.确保您没有添加任何带有导航按钮或链接或类似格式的行,这些行的格式可能与其他行的格式不同.
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.
这篇关于数据表:类型错误:我未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!