0.3.0 • Published 4 years ago

json-table-converter v0.3.0

Weekly downloads
252
License
GPL-3.0
Repository
github
Last release
4 years ago

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

ParamTypeDescription
jsonObject | Array
optionsObject
options.tableStyleString<table/> Style
options.trStyleString<tr/> Style
options.thStyleString<th/> Style
options.tdStyleString<td/> Style
options.tdKeyStyleString<td/> Key Style
options.formatCellFunctionCell Value Format Function

API Flow Example

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
0.3.0

4 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago