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

fix(table): no border-bottom when the cells are merged #38735

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/table/style/bordered.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { CSSObject } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../theme';
import type { TableToken } from './index';

const genBorderedStyle: GenerateStyle<TableToken, CSSObject> = token => {
const genBorderedStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
const { componentCls } = token;
const tableBorder = `${token.lineWidth}px ${token.lineType} ${token.tableBorderColor}`;

Expand Down Expand Up @@ -36,6 +36,7 @@ const genBorderedStyle: GenerateStyle<TableToken, CSSObject> = token => {
// ============================ Content ============================
[`> ${componentCls}-container`]: {
borderInlineStart: tableBorder,
borderBlockEnd: tableBorder,

[`
> ${componentCls}-content,
Expand Down
8 changes: 2 additions & 6 deletions components/table/style/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface TableToken extends FullToken<'Table'> {
tableScrollBg: string;
}

const genTableStyle: GenerateStyle<TableToken, CSSObject> = token => {
const genTableStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
const {
componentCls,
fontWeightStrong,
Expand Down Expand Up @@ -193,10 +193,6 @@ const genTableStyle: GenerateStyle<TableToken, CSSObject> = token => {
},
},

'&:last-child > td': {
borderBottom: tableBorder,
},

[`&:first-child > td,
&${componentCls}-measure-row + tr > td`]: {
borderTop: 'none',
Expand Down Expand Up @@ -265,7 +261,7 @@ const genTableStyle: GenerateStyle<TableToken, CSSObject> = token => {
};

// ============================== Export ==============================
export default genComponentStyleHook('Table', token => {
export default genComponentStyleHook('Table', (token) => {
const {
controlItemBgActive,
controlItemBgActiveHover,
Expand Down