版本
Antd @5.x.x
React @18.x.x
Tsx
javascript
<Table
dataSource={SocrePaMing.length > 0 ? SocrePaMing : []}
columns={tableScoreColumns}
rowKey="attribute"
pagination={false}
className="custom-table"
scroll={{ y: 400 }}
/>
Css
css
.ant-table-body {
scrollbar-width: auto;
scrollbar-color: auto;
}
::-webkit-scrollbar {
width: 5px;
height: 5px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 10px;
background: rgba(0, 0, 0, 0.1);
-webkit-box-shadow: inset006pxrgba(0, 0, 0, 0.5);
}
::-webkit-scrollbar-thumb:window-inactive {
background: rgb(219, 219, 219);
}