diff --git a/package.json b/package.json index f36ecb9..321b5ae 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "0.6.4", + "version": "0.6.5", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/components/Table/Table.tsx b/src/components/Table/Table.tsx index 8983112..43796f4 100644 --- a/src/components/Table/Table.tsx +++ b/src/components/Table/Table.tsx @@ -39,14 +39,17 @@ const CustomizedTable:React.FC = (props) => { }; let rows = props.tabledata; + console.log(rows) + console.log(rows + .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)) return ( <> - {props.tabledata[0].map(t=>{ - return {t.header} + {props.tabledata[0].map((t,k)=>{ + return {t.header} })} @@ -56,8 +59,8 @@ const CustomizedTable:React.FC = (props) => { .map((row,i) => { return( - {row.map(v=>{ - return { v.render ? v.render : v.value} + {row.map((v,j)=>{ + return { v.render ? v.render : v.value} }) } diff --git a/stories/Table.stories.tsx b/stories/Table.stories.tsx index 086fc18..3ecba06 100644 --- a/stories/Table.stories.tsx +++ b/stories/Table.stories.tsx @@ -33,7 +33,7 @@ export const Table = Template.bind({ }); const tdata = Array.from(Array(1000).keys()).map((a)=> { //return { Symbol: 'S'+ a, 'Score 1':a, 'Score 2':1,'Score 3':4,'Score 4':6,'Score 5':9,'Score 6':0,'Score 7':9,'Score 8':1,'Score 9':2,'Score 10':5,'Score 11':12} - return [{header: 'Symbol', value: a},{ header: 'Score', value: 'score '+ a, render: {'test'+a}}] + return [{header: 'Symbol 1', value: 'ss '+a},{header: 'Symbol 1', value: 'ss '+a},{header: 'Symbol 1', value: 'ss '+a},{header: 'Symbol 1', value: 'ss '+a},{header: 'Symbol 1', value: 'ss '+a},{header: 'Symbol 1', value: 'ss '+a},{header: 'Symbol 2', value: a},{header: 'Symbol 3', value: a},{header: 'Symbol 4', value: a},{ header: 'Score', value: 'score '+ a, render: {'test'+a}}] }) Table.args = { rowsPerPage: [10,100], tabledata: tdata};