表格化返回[object Object]

时间:2018-05-10 02:54:42

标签: javascript html node.js npm html-table

我试图在节点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>

为什么它不会返回数组的内容?

0 个答案:

没有答案