From 0941a1d4fbd10f91afd2f421208d6a82a48c1126 Mon Sep 17 00:00:00 2001 From: dengfuping Date: Fri, 17 Jan 2025 14:14:37 +0800 Subject: [PATCH] improve(design): middle and small Table empty height --- packages/design/src/table/style/index.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/packages/design/src/table/style/index.ts b/packages/design/src/table/style/index.ts index 90a50d2d5..3d2bbebd6 100644 --- a/packages/design/src/table/style/index.ts +++ b/packages/design/src/table/style/index.ts @@ -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', @@ -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: 水平滚动