I'm using antd table for data viewing and used separate antd pagination .I want to set page size of the antd table how to achive it.I'm not using default table pagination in antd table
<Pagination defaultCurrent={1} total={data.length} pageSize={2} onChange={this.setPaginationData}/>
<Table
rowKey={data._id}
columns={this.columns1}
rowSelection={this.rowSelection}
expandedRowRender={(record, index, indent, expanded) =>
this.expanding(record, expanded)
}
// pagination={{defaultCurrent:1, total:data.length, pageSize:2,position:'top'}}
onExpand={this.onExpand}
dataSource={data} />
please help...
You can simply pass an Pagination
object:
<Table pagination={{ pageSize: 6}} />
You want to set page size without setting the pagination, so your only option is to limit the data
:
const PAGE_SIZE = 5;
<Table dataSource={data.slice(PAGE_SIZE)} />;
Refer to Array#slice
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With