在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:lightswitch05/table-to-json开源软件地址:https://github.com/lightswitch05/table-to-json开源编程语言:JavaScript 98.7%开源软件介绍:Table To JSONjQuery plugin to serialize HTML tables into javascript objects. Links
CDNIt is recommended to pull this tool into your project directly. But if you insist to use a CDN, here is one:
Features
Options
Example<table id='example-table'>
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th data-override="Score">Points</th></tr>
</thead>
<tbody>
<tr>
<td>Jill</td>
<td>Smith</td>
<td data-override="disqualified">50</td></tr>
<tr>
<td>Eve</td>
<td>Jackson</td>
<td>94</td></tr>
<tr>
<td>John</td>
<td>Doe</td>
<td>80</td></tr>
<tr>
<td>Adam</td>
<td>Johnson</td>
<td>67</td></tr>
</tbody>
</table>
<script type="text/javascript">
// Basic Usage
var table = $('#example-table').tableToJSON();
// table == [{"First Name"=>"Jill", "Last Name"=>"Smith", "Score"=>"disqualified"},
// {"First Name"=>"Eve", "Last Name"=>"Jackson", "Score"=>"94"},
// {"First Name"=>"John", "Last Name"=>"Doe", "Score"=>"80"},
// {"First Name"=>"Adam", "Last Name"=>"Johnson", "Score"=>"67"}]
// Ignore first column (name)
var table = $('#example-table').tableToJSON({
ignoreColumns: [0]
});
// table == [{"Last Name"=>"Smith", "Score"=>"disqualified"},
// {"Last Name"=>"Jackson", "Score"=>"94"},
// {"Last Name"=>"Doe", "Score"=>"80"},
// {"Last Name"=>"Johnson", "Score"=>"67"}]
</script> Contributing
Looking for a server-side solution?Colin Tremblay is working on a PHP implementation at HTML-Table-To-JSON Special Thanks
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论