1.0.2 • Published 3 years ago
table_library_by_alex v1.0.2
Usage
First simple variant
const data = [
['cell1', 'cell2', 'cell3', 'cell4'],
['cell1', 'cell2', 'cell3', 'cell4'],
['cell1', 'cell2', 'cell3', 'cell4'],
['cell1', 'cell2', 'cell3', 'cell4'],
];
<Table
data={data}
onAdd={fn}
onRemove={fn}
onEdit={fn}
/>
Second custom table variant
const data = {
header: [
{ title: "title1" },
{ title: "title2" },
],
rows: [
[
{ value: "Test" },
{ value: 1 },
{ value: "test data" },
{ value: 20000000 },
{ value: "more test data text for example" }
]
]
};
<Table
data={data}
onAdd={fn}
onRemove={fn}
onEdit={fn}
/>
fn(table) {
//a new table will be returned in the parameter,
//on each event
}
Install
With npm installed, run
npm install --save table_library_by_alex@1.0.2
or
yarn add table-library-by-Alex-Morhun
License
ISC