This is a dead simple Javascript library for converting json to HTML table.
- Visualize nested json
- Support json in string format
- Callback support
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
<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.