Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Latest commit

 

History

History
52 lines (37 loc) · 1.16 KB

README.md

File metadata and controls

52 lines (37 loc) · 1.16 KB

JsonToHtmlTable

Current npm version Dependency free Code coverage Known Vulnerabilities Code quality

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.