This commit is contained in:
=
2026-04-03 14:16:13 +10:00
parent b096ac7aa3
commit f76757311f
3 changed files with 17 additions and 3 deletions

View File

@@ -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 &&