install this package using: npm install --save html-react-table
import ReactHtmlTable from 'html-react-table';
const columns = [{ key: 'id', name: 'ID' }, { key: 'title', name: 'Title' },
{ key: 'company', name: 'Company' }];
// in columns pass the header attribute of table
const rows = [{ id: x, title: 'Title x', company: 'Company x' }, ...];
// in rows pass the body json of table based on header attribute
const ReactTable = () => {
return
columns={columns}
rows={rows}
/>);
}
for more info: https://www.npmjs.com/package/html-react-table
Top comments (0)