-1
我有這樣的警告JQquery數據表警告時表爲空
數據表警告(表ID = 'datatabledetail'):TD元件的意外的數目 。預期3並得到0.數據表在表體中不支持 rowspan/colspan,並且每個行/列組合必須有一個單元格用於 。
,當我的表是空的,
我必須做什麼?
這是我的DataTable中庫數據表
var oTableDetail = $('#datatabledetail').dataTable({
"bSort": false,
"bAutoWidth": false,
"bProcessing": false,
"bFilter": false,
"bPaginate": false,
"aoColumns": [
{ "mDataProp": "Id", "bVisible": true },
{ "mDataProp": "CodeValue", "bVisible": true },
{ "mDataProp": "NameValue", "bVisible": true }
]//
,
"aoColumnDefs": [
{
"fnRender": function (o) {
return "<center> <input type='button' id='" + o.aData['Id'] + "' class='cremove mws-button blue' value='Remove'></center>";
},
"aTargets": [0]
}
]
});
這是我的代碼,代碼的html
<table cellpadding="0" cellspacing="0" border="0" class="mws-table" id="datatabledetail"
width="100%">
<thead>
<tr>
<th style="text-align: center; width: 5%;">
Action
</th>
<th style="text-align: center; width: 40%;">
Food Name
</th>
<th style="text-align: center; width: 10%;">
Food Code
</th>
</tr>
</thead>
<tbody>
<tr>
</tr>
</tbody>
</table>
顯示數據表代碼... – 2014-08-29 04:25:58
顯示它的html – 2014-08-29 04:26:13
只顯示一些東西 – Mysteryos 2014-08-29 04:27:05