2016-07-25 25 views
-2

我加了一個數據表中的一個頁面,但它不應該得到的數據表格式我沒有得到的數據表格式,在我的頁面

<script src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> 
<script src="https://cdn.datatables.net/1.10.12/js/dataTables.bootstrap.min.js"></script> 
<table class="example3" id="example1"> 
    <tr> 
     <td></td> 
     <td></td> 
    </tr> 
</table> 

<script> 
    $(document).ready(function() { 
    $('.example3').DataTable(); 
    alert('1234567890'); 

    }); 
</script> 

我得到了這樣的錯誤,我查了一下這兩個class和id他們都來自數據庫類 。如果我刪除了數據,我也沒有得到這些值。

類型錯誤:未定義C

...ldren("th, td").each(function(a,b){var c=o.aoColumns[a];if(c.mData===a){var d=s(... 

請讓我知道在哪裏的錯誤是,因爲在其他項目中使用相同的代碼工作。

+0

我們需要你的代碼的更多信息,因爲它看來,你有什麼作品精絕:https://jsfiddle.net/zdrpd2fs/ –

+1

嘗試添加標籤與行標題 – rad11

回答

0

您的表必須具有正確的結構,請參閱Installation - HTML

<table class="example3" id="example1"> 
    <thead> 
    <tr> 
     <th>Heading 1</th> 
     <th>Heading 2</th> 
    </tr> 
    </thead> 
</table> 
相關問題