我试图在节点JS中使用tableify将以下JSON数组转换为html表:
[{"ID":"1", "Name":"John"},{"ID":"2", "Name":"Mary"}] (this is a subset of the array shortened for this post. The format is the same)
当我跑步时:
var tableify = require('tableify');
var html = tableify(recordset);
console.log(html);
这回来了:
<table><tbody><tr><td class="object"><td class="undefined"></td></td><td class="object"><td class="undefined"></td></td><td class="object"><td class="undefined"></td></td><td class="object"><td class="undefined"></td></td></tr></tbody></table>
为什么它不会返回数组的内容?