我希望能够生成树形视图的HTML表格。
为此,我有以下对象数组:
在这个fiddle中,您可以看到一个硬编码的表格(这是我必须实现的结果,但是动态的),还有我提供的要使用的数组:
为此,我有以下对象数组:
var data = [{
"Column01": "1",
"Column02": null,
"Column03": null,
"Column04": "25.00"
},{
"Column01": "1",
"Column02": "Alabama",
"Column03": null,
"Column04": "25.00"
},{
"Column01": "1",
"Column02": "Alabama",
"Column03": " Birmingham",
"Column04": "25.00"
},{
"Column01": "2",
"Column02": null,
"Column03": null,
"Column04": "75.00"
},{
"Column01": "2",
"Column02": "Alaska",
"Column03": null,
"Column04": "75.00"
},{
"Column01": "2",
"Column02": "Alaska",
"Column03": " Fairbanks",
"Column04": "75.00"
},{
"Column01": "3",
"Column02": null,
"Column03": null,
"Column04": "50.00"
},{
"Column01": "3",
"Column02": "California",
"Column03": null,
"Column04": "50.00"
},{
"Column01": "3",
"Column02": "California",
"Column03": " San Francisco",
"Column04": "50.00"
},{
"Column01": "4",
"Column02": null,
"Column03": null,
"Column04": "100.00"
},{
"Column01": "4",
"Column02": "Indiana",
"Column03": null,
"Column04": "100.00"
},{
"Column01": "4",
"Column02": "Indiana",
"Column03": "Indianapolis",
"Column04": "100.00"
}];
这是我的对象在表格视图中
如何修改我的对象(数据)以便能够轻松生成树形视图?在这个fiddle中,您可以看到一个硬编码的表格(这是我必须实现的结果,但是动态的),还有我提供的要使用的数组: