问题一、设置 y 之后,侧边栏出现白边:https://github.com/react-component/table/issues/998
问题二、设置scroll y之后,x为max-content失效
github地址:https://github.com/ant-design/ant-design/issues/29283
临时解决方案:
.App {
padding: 20px;
}
.ant-table-content {
overflow: auto !important;
max-height: 300px !important;
}
.ant-table-thead {
position: sticky;
top: 0;
z-index: 1;
}
<div className="App">
<h1>antd version: {version}</h1>
<Table columns={columns} dataSource={getData()} scroll={{
x: "max-content"
}} />
</div>
问题三:设置吸顶的时候出现双滚动条:
github 相关issue:Table在sticky和固定某些列的情况下,当触发吸顶效果时,会出现双滚动条