json-table-converter

0.3.0 • Public • Published

JSON To Table

A JavaScript library to convert JSON data to Table.

Feature

  • Convert JSON To <table />

Usage

npm install json-table-converter

API

jsonToTableHtmlString(json, options)

Convert Json to <table />

Param Type Description
json Object | Array
options Object
[options.tableStyle] String <table/> Style
[options.trStyle] String <tr/> Style
[options.thStyle] String <th/> Style
[options.tdStyle] String <td/> Style
[options.tdKeyStyle] String <td/> Key Style
[options.formatCell] Function Cell Value Format Function

API Flow Example

flow

Demo

const { jsonToTableHtmlString } = require('json-table-converter')
const html = jsonToTableHtmlString(json, {
  tableStyle: string, // <table/> Style
  trStyle: string,    // <tr/> Style
  thStyle: string,    // <th/> Style
  tdStyle: string,    // <td/> Style
  tdKeyStyle: string, // <td/> Key Style
  formatCell: (cellValue, isKeyCell) => newCellValue,
})

Donation

If you find this project useful, you can buy us a cup of coffee:


Contributors

chuyik
chuyik

Readme

Keywords

Package Sidebar

Install

npm i json-table-converter

Weekly Downloads

297

Version

0.3.0

License

GPL-3.0

Unpacked Size

50.5 kB

Total Files

11

Last publish

Collaborators

  • chuyik