JSON to HTML table converter – jQuery htmlson.js plugin

Convert JSON array of objects into to HTML table! jQuery htmlson.js is a JSON to HTML table converter.

JSON to HTML table directly

No need for tedious JSON data processing. There is an easy way out. Get and render the data as HTML table.

Key features:

– Convert JSON array of objects into to HTML table

– Convert HTML table into JSON object

Available configurations:

– data: array (array of objects)

– headers: object (key-value pair index by the number of row and the custom name of the value)

– debug: boolean

jQuery JSON to HTML converter
jQuery JSON to HTML converter

Setup

npm install htmlson.js

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

Samples

// 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);

License: MIT

Homepage

https://adalenv.github.io/htmlson.js

GitHub

https://github.com/adalenv/htmlson.js

scraperapi

See also

JavaScript JSON editor online

Responsive table header and columns freezing – jquery-freeze-table

jQuery JSON form builder – HTML forms from JSON Schema

jQuery convert JSON to grid plugin – Columns

CSV in JavaScript / es6 – Parse CSV with PapaParse

Enjoy!