JQuery datatables 报错:TypeError: aLayout[(i + k)] is undefined,遇到上述的错误,原因是因为jsp中 th中出现了<th rowspan="2">测试</th>这样的语句,去掉rowspan问题解决,猜测应该是因为无法识别这样的语句的原因:
原来的jsp界面是这样的:
<table class="table table-striped table-bordered table-hover"
id="sample_1" cellspacing="0" width="100%"
style="margin-top:0px;display:none;">
<thead>
<tr>
<th rowspan="2">测试</th>
<th rowspan="2">测试</th>
<th rowspan="2">测试</th>
<th rowspan="2">测试</th>
<th rowspan="2">测试</th>
</tr>
</thead>
</table>
修改如下:
<table class="table table-striped table-bordered table-hover"
id="sample_1" cellspacing="0" width="100%"
style="margin-top:0px;display:none;">
<thead>
<tr>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
<th>测试</th>
</tr>
</thead>
</table>
具体原因不是很懂,记录一下