jsontohtmltable
v1.1.2
Published
Make json more readable as html table
Downloads
9
Readme
JsonToHtmlTable
This is a dead simple Javascript library for converting json to HTML table.
Features
- Visualize nested json
- Support json in string format
- Callback support
How to use it
Import
import jsonToHtmlTable.min.js
in a html script tag
<script src="jsonToHtmlTable.min.js"></script>
or download via npm
npm install jsontohtmltable
or add via yarn
yarn add jsontohtmltable
Usage
<table id="test-table"></table>
<script>
var json = { name: 'Alex', age: 16 };
var callbackFunc = function() {
console.log('This is generated by a callback function');
};
JsonToHtmlTable(document.getElementById('test-table'), json, callbackFunc);
</script>
See sample.html
for more details.