lab fix
This commit is contained in:
@@ -20,7 +20,12 @@ const Table = (props) => {
|
||||
};
|
||||
|
||||
//количество страниц разбиения таблицы
|
||||
const n = Math.ceil(dataTable.length / props.amountRows);
|
||||
let n = Math.ceil(dataTable.length / props.amountRows);
|
||||
let rowCount = props.amountRows;
|
||||
if(props.disablePagination){
|
||||
n=1;
|
||||
rowCount=dataTable.length;
|
||||
}
|
||||
|
||||
// массив с номерами страниц
|
||||
const arr = Array.from({ length: n }, (v, i) => i + 1);
|
||||
@@ -37,7 +42,7 @@ const Table = (props) => {
|
||||
|
||||
<table>
|
||||
<TableHead head={Object.keys(props.data[0])} />
|
||||
<TableBody body={dataTable} amountRows={props.amountRows} numPage={activePage} />
|
||||
<TableBody body={dataTable} amountRows={rowCount} numPage={activePage} />
|
||||
</table>
|
||||
|
||||
{n>1 &&
|
||||
|
||||
Reference in New Issue
Block a user