json table html,GitHub - afshinm/Json-to-HTML-Table: Simple Json to standard HTML table converter in...

Annoucement: We have developed a full-featured table library that supports JSON input as well. Please use Grid.js instead.

JSON to HTML Table

This is a simple script to convert JSON data to standard HTML table in the simplest and fastest way.

How to use

There'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 ConvertJsonToTable method and fill the parsedJson parameter.

Example

This 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:

First parameter is JSON data

table HTML id attribute will be jsonTable

table HTML class attribute will not be added

Download text will be displayed instead of the link itself

Contributors

Contributing

This is a open-source project. Fork the project, complete the code and send pull request.

License

Copyright (C) 2012 Afshin Mehrabani (afshin.meh@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated

documentation files (the "Software"), to deal in the Software without restriction, including without limitation

the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,

and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions

of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED

TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF

CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS

IN THE SOFTWARE.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
要解决git下载报错的问题,你可以尝试以下步骤: 1. 首先,你可以使用git clone命令来克隆仓库。命令格式如下: git clone https://<token>@github.com/<user>/<repo>.git 2. 如果你在使用git clone命令时遇到报错,可能是因为访问权限的问题。你可以尝试使用git remote set-url命令来设置远程仓库的URL。命令格式如下: git remote set-url origin https://<token>@github.com/<user>/<repo>.git 3. 在执行上述步骤后,再次尝试使用git clone命令来克隆仓库,应该就能成功了。 总结:你可以尝试使用git clone命令和git remote set-url命令来解决git下载报错的问题。具体步骤和命令格式可以参考上述引用的内容。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [解决报错:fatal: Authentication failed for ‘https://github.com/*/*.git/](https://blog.csdn.net/liuzehn/article/details/128037853)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [解决git下载报错:fatal: unable to access ‘https://github.com/.../.git/‘:](https://blog.csdn.net/xyaicwj/article/details/125256149)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值