首页 > 解决方案 > 表化返回 [object Object]

问题描述

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

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

标签: javascripthtmlnode.jsnpmhtml-table

解决方案


推荐阅读