0.3.0 • Published 6 years ago
json-table-converter v0.3.0
JSON To Table
A JavaScript library to convert JSON data to Table.
Feature
- Convert JSON To <table />
Usage
npm install json-table-converterAPI
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
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 |