问题
I am trying to apply jQuery datatables on piece of HTML. The markup consists of nested tables which is creating a problem.
Error by the Error Console is :- "nCell is undefined".
It is a bit confusing that why Datatables on nested tables is not working? Is it that jQuery Datatables does not support nested tables or i am missing out something? Here is the markup i have written :
<script type="text/javascript">
$(document).ready(function() { $('#table_id,#id2').dataTable();} );
</script>
</head>
<body text="#000000" link="#000000" alink="#000000" vlink="#000000">
<table id="table_id">
<thead>
<tr>
<th> AAA</th>
<td> BBB</td>
<td> CCC</td>
</tr>
</thead>
<tbody>
<tr>
<td>Row 1 Data 1</td>
<td>Row 1 Data 2</td>
<td>etc</td>
</tr>
<tr>
<td>Row 2 Data 1</td>
<td>Row 2 Data 2</td>
<td>etc</td>
</tr>
<tr>
<td> <table id ="id2">
<thead>
<tr>
<th>JJJJ</th>
<th>KKK</th>
</tr>
</thead>
<tbody>
<tr>
<td>LLL</td>
<td>MMM</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
来源:https://stackoverflow.com/questions/15900392/jquery-datatables-not-working-with-nested-tables