Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve(design): middle and small Table empty height #947

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion packages/design/src/table/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const genTableStyle = (token: TableToken): CSSObject => {
borderBottom: 'none',
},
[`${componentCls}-empty-wrapper`]: {
minHeight: 360,
minHeight: 360 - token.paddingSM * 2,
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
Expand All @@ -116,6 +116,24 @@ export const genTableStyle = (token: TableToken): CSSObject => {
},
},

// middle 表格样式
[`${componentCls}-wrapper ${componentCls}${componentCls}-middle`]: {
[`${componentCls}-tbody`]: {
[`${componentCls}-empty-wrapper`]: {
minHeight: 260 - token.paddingXS * 2,
},
},
},

// small 表格样式
[`${componentCls}-wrapper ${componentCls}${componentCls}-small`]: {
[`${componentCls}-tbody`]: {
[`${componentCls}-empty-wrapper`]: {
minHeight: 160 - token.paddingXXS * 2,
},
},
},

// 滚动表格样式
// 由于滚动表格会在 tbody 下最前面多一个 tr 元素,因此需要设置相反的斑马条样式
// .ant-table-scroll-horizontal: 水平滚动
Expand Down
Loading