Commit dcf8ae65 authored by 涂茜's avatar 涂茜

fix: update table

parent a834a2fe
Pipeline #25681 passed with stages
in 4 minutes 11 seconds
......@@ -45,7 +45,7 @@ const Demo = () => {
return (
<div style={{ height: '400px' }}>
{!!dataSource.length && (
<BasicTable dataSource={dataSource} columns={columns} scroll={{ y: 294 }} />
<BasicTable dataSource={dataSource} columns={columns} bordered={true} />
)}
{!dataSource.length && <Empty description={'暂无数据'} />}
</div>
......
......@@ -8,7 +8,7 @@ const BasicTable = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('basic-table');
return <Table className={classNames(prefixCls)} {...props} bordered />;
return <Table className={classNames(prefixCls)} scroll={{ y: 'calc(100% - 40px)' }} {...props} />;
};
BasicTable.defaultProps = {
......
......@@ -2,16 +2,21 @@
@basic-table-prefix-cls: ~'@{ant-prefix}-basic-table';
.@{basic-table-prefix-cls} {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
.ant-table-wrapper,
.ant-spin-nested-loading,
.ant-spin-container {
height: 100%;
}
.ant-table.ant-table-bordered {
height: calc(100% - 64px);
.ant-spin-container,
.ant-table,
.ant-table-container,
.ant-table-content {
display: flex;
flex: 1;
flex-direction: column;
overflow: hidden;
}
.ant-table-tbody > tr {
......@@ -22,10 +27,6 @@
background: rgba(255, 255, 255, 0);
}
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
background: rgba(255, 255, 255, 0);
}
.ant-table-thead > tr > th {
font-weight: 600;
background: white;
......@@ -37,7 +38,10 @@
.ant-table tfoot > tr > th,
.ant-table tfoot > tr > td {
padding: 8px 8px;
border-right: 1px solid #dbe7fb;
}
.ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td {
background: rgba(255, 255, 255, 0);
}
.ant-table-tbody > tr:nth-child(2n-1) {
......@@ -48,6 +52,10 @@
background: #edf2ff;
}
.ant-table-tbody > tr > td {
border-bottom: 1px solid #dbe7fb;
}
.ant-table.ant-table-bordered
> .ant-table-container
> .ant-table-content
......@@ -116,8 +124,4 @@
border-right: 0;
border-bottom: 0;
}
.ant-table-tbody > tr > td {
border-bottom: 1px solid #dbe7fb;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment