简体   繁体   中英

Showing number of entries needed in antd table in react JS

I am using antd Table( https://ant.design/components/table/ ) in my react project. I want to show the number of entries for the table like the below picture.

在此处输入图片说明

I am importing Table from antd Then using this code

<Table
                    className="table-layout"
                    columns={this.state.columns}
                    dataSource={filteredData} 
                    bordered={true}
                    size={"small"}
                    onRowDoubleClick={ (record, index, event) => this.handleEditModal(record) }
                    onRowClick={(record, index, event) => this.handleRowClick(record)}
                    loading={this.state.loading}
                    pagination={{ pageSize: 14 }}  
                    rowClassName={(record) => this.state.selectedItemKey == record.key ? 'table-layout selected' :  record.IsDefaultAccount ? 'table-layout active' : 'table-layout' }                 
                />

Is is possible in antd table? If so how to do it?

您共享的沙盒的屏幕截图

You can use antd pagination component and can achieve your need like mentioned below

import { Pagination } from 'antd'; 
<Pagination size="small" total={50} showSizeChanger />

and can refer to antd pagination demo and documentation at this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM