jsonify-my-table

Convert a HTML table to JSON
git clone http://git.hanabi.in/repos/jsonify-my-table.git
Log | Files | Refs | LICENSE

commit c5988b8daa51e2d4f826a61b5bb8896bbdad52e4
parent 635cc1d6df59ceda18e835811a4aa878ad3dcc5d
Author: Agastya Chandrakant <acagastya@outlook.com>
Date:   Thu, 13 Jun 2019 20:06:07 +0530

delete
Diffstat:
Dtable2json.min.js | 1-
1 file changed, 0 insertions(+), 1 deletion(-)

diff --git a/table2json.min.js b/table2json.min.js @@ -1 +0,0 @@ -class table2json{constructor(e){if(this.table=document.getElementById(e),!this.table)return this.error=!0,void console.error("Table not found.");this.headers=[];for(let e=0;e<this.table.rows[0].cells.length;e+=1)this.headers.push(this.table.rows[0].cells[e].innerText);if(this.headers.length>new Set(this.headers).size)return this.error=!0,void console.error("Headers repeat.");this.res=[];for(let e=1;e<this.table.rows.length;e+=1){let t=[];for(let s=0;s<this.table.rows[e].cells.length;s+=1)t.push(this.table.rows[e].cells[s].innerText);let s={};this.headers.forEach((e,r)=>s={...s,[e.valueOf()]:t[r]}),this.res.push(s)}}}exports.table2json=table2json;