htmlson.js

Convert JSON array of objects into to HTML table!

N|Solid

Features

Available configurations:

Demo

Installation

Using NPM:


npm install htmlson.js

Include:

<script src="node_modules/htmlson.js/dist/htmlson.min.js"></script>
 

Usage

htmlson.js requires a min version 1.9.1 of jQuery to run.

Initialize:

var htmlson = $('.testTable').htmlson({
    data: data,
    headers: {
        1: 'custom header name'
    },
    debug: true
}); 

Convert html table to JSON object:

var obj = htmlson.toJson();

Add row:

htmlson.addRow({
   "name": "New Kitty",
   "species" : "cat",
   "foods": {
       "likes": ["old food"],
       "dislikes": ["new food"]
   }
});

Remove row by index:

htmlson.removeRow(1);

Authors: