Skip to content

Commit

Permalink
Merge pull request #879 from oceanbase/dengfuping-dev
Browse files Browse the repository at this point in the history
fix(design): should remove cell border for normal Table
  • Loading branch information
dengfuping authored Dec 10, 2024
2 parents afb2748 + 827b0aa commit 44db14e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions packages/design/src/table/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ export const genTableStyle: GenerateStyle<TableToken> = (token: TableToken): CSS
},
},

// 非可展开表格、带 footer 表格、空表格、带边框表格: 底部添加分隔线
[`${componentCls}-wrapper:not(${componentCls}-expandable):not(${componentCls}-has-footer) ${componentCls}:not(${componentCls}-bordered):not(${componentCls}-empty)`]:
{
borderBottom: `1px solid ${colorBorderSecondary}`,
borderRadius: 0,
},

// 滚动表格样式
// 由于滚动表格会在 tbody 下最前面多一个 tr 元素,因此需要设置相反的斑马条样式
// .ant-table-scroll-horizontal: 水平滚动
Expand All @@ -151,6 +144,24 @@ export const genTableStyle: GenerateStyle<TableToken> = (token: TableToken): CSS
},
},

// 非可展开表格、不带 footer 表格、非空表格、不带边框表格: 底部添加分隔线
[`${componentCls}-wrapper:not(${componentCls}-expandable):not(${componentCls}-has-footer) ${componentCls}:not(${componentCls}-bordered):not(${componentCls}-empty)`]:
{
borderBottom: `1px solid ${colorBorderSecondary}`,
borderRadius: 0,
},

// 去掉非展开表格的边框
[`${componentCls}-wrapper:not(${componentCls}-expandable)`]: {
[`${componentCls}:not(${componentCls}-bordered)`]: {
[`${componentCls}-tbody`]: {
[`tr:not(${componentCls}-measure-row) > td`]: {
border: 'none',
},
},
},
},

// 可展开表格样式
[`${componentCls}-wrapper${componentCls}-expandable`]: {
[`${componentCls}`]: {
Expand Down

0 comments on commit 44db14e

Please sign in to comment.