create a json array from html table

后端 未结 5 2021
渐次进展
渐次进展 2020-12-30 17:30

i have C++ program exporting log files as HTML table and I wanted to know if there is any way that i can parse that table(something like this):

5条回答
  •  不知归路
    2020-12-30 17:52

    I needed the same thing except with the ability to ignore columns, override values, and not be confused by nested tables. I ended up writing a jQuery plugin table-to-json:

    https://github.com/lightswitch05/table-to-json

    All you have to do is select your table using jQuery and call the plugin:

    var table = $('#example-table').tableToJSON();
    

    Here is a demo of it in action using your data:

    http://jsfiddle.net/dGPks/199/

提交回复
热议问题