在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:afshinm/Json-to-HTML-Table开源软件地址:https://github.com/afshinm/Json-to-HTML-Table开源编程语言:JavaScript 100.0%开源软件介绍:Grid.js instead.Annoucement: We have developed a full-featured table library that supports JSON input as well. Please useJSON to HTML TableThis is a simple script to convert JSON data to standard HTML table in the simplest and fastest way. How to useThere's only one function in this library and accept four parameter that only the first one is required. function ConvertJsonToTable(parsedJson, tableId, tableClassName, linkText) Simply call ExampleThis is an example of using this library: //Example data, Object
var objectArray = [{
"Total": "34",
"Version": "1.0.4",
"Office": "New York"
}, {
"Total": "67",
"Version": "1.1.0",
"Office": "Paris"
}];
//Example data, Array
var stringArray = ["New York", "Berlin", "Paris", "Marrakech", "Moscow"];
//Example data, nested Object. This data will create nested table also.
var nestedTable = [{
key1: "val1",
key2: "val2",
key3: {
tableId: "tblIdNested1",
tableClassName: "clsNested",
linkText: "Download",
data: [{
subkey1: "subval1",
subkey2: "subval2",
subkey3: "subval3"
}]
}
}]; Code sample to create a HTML table from JSON: //Only first parameter is required
var jsonHtmlTable = ConvertJsonToTable(objectArray, 'jsonTable', null, 'Download'); Code sample explaned:
ContributorsAfshin Mehrabani (@afshinmeh) ContributingThis is a open-source project. Fork the project, complete the code and send pull request. License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论