📜  jquery json to table - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:46.443000             🧑  作者: Mango

代码示例3
function arrayToTable(tableData) {
    var table = $('
'); $(tableData).each(function (i, rowData) { var row = $(''); $(rowData).each(function (j, cellData) { row.append($(''+cellData+'')); }); table.append(row); }); return table; } $('body').append(arrayToTable([ ["John","Slegers",34], ["Tom","Stevens",25], ["An","Davies",28], ["Miet","Hansen",42], ["Eli","Morris",18] ]));