【发布时间】:2018-07-18 10:31:52
【问题描述】:
我的序列化 JSON 数组是这样的:
[
[null, null, null, null, null],
[null, "Rough Costing", null, null, null],
[null, null, null, null, null],
[null, "Client", "Ua Limited", null, null],
[null, "Product", null, null, null],
[null, "Pro: Name", "Idam ", null, null],
[null, "Est.: No", null, null, null],
[null, "Time: period ", "43299", null, null],
[null, "Date", "15th July - 2018", null, null],
[null, null, null, null, null]
]
jQuery DataTables 查询是这样的:
<table id="example" class="display" style="width:100%">
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
</tr>
</thead>
</table>
$('#example').DataTable({
"ajax": {
"url": "/POPM_Trn_IOU/ExportToExcel",
"dataSrc": ""
},
});
但这只会填充第一列下的 DataTables 行,因为我猜没有列定义。但同样有效here。
如何在我的实际应用中处理这个问题?
【问题讨论】:
-
您遇到了什么问题?任何错误或任何东西..在你的问题中描述它。
-
它应该像链接中的在线示例一样,但在我的实际应用程序中,它垂直填充在第一列下方。不像示例中的那样。
-
您可以添加您尝试过的屏幕截图或小提琴。
-
@Raga N,您的 json 数据似乎有问题。
标签: jquery datatables