0
我有這樣的JSON數據負載JSON數據到數據表
{ "aaData" : [
[ { "field1" : "value11", "field2" : "value12", "field3" : "value13" },
{ "field1" : "value21", "field2" : "value22", "field3" : "value33" } ]
]}
如何這樣的數據加載到數據表? 我的初始化函數看起來像這樣
var oTable1 = $('#usertable').dataTable({
"sPaginationType": "bs_full",
"bProcessing" : true,
"sAjaxSource" : "loadusers.html" });
而且在html
<table class="datatable table table-striped table-bordered" id="usertable">
<thead>
<th>Field1</th>
<th>Field2</th>
<th>Field3</th>
</thead>
<tbody></tbody>
</table>
也 - 這是你所尋找的相同? - http://stackoverflow.com/questions/1051061/convert-json-array-to-an-html-table-in-jquery –