Jquery Datatables not working with nested tables

你离开我真会死。 提交于 2020-01-07 04:36:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!