Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 0 additions & 4 deletions packages/components/table/BaseTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,6 @@ const BaseTable = forwardRef<BaseTableRef, BaseTableProps>((originalProps, ref)
if (col.minWidth) {
style.minWidth = formatCSSUnit(col.minWidth);
}
// 没有设置任何宽度的场景下,需要保留表格正常显示的最小宽度,否则会出现因宽度过小的抖动问题
if (!style.width && !col.minWidth && props.tableLayout === 'fixed') {
style.minWidth = '80px';
}
return <col key={col.colKey || index} style={style} />;
})}
</colgroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,9 @@ exports[`BaseTable Pagination > locale data pagination controlled > pagination.c
class="t-table--layout-fixed"
>
<colgroup>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col />
<col />
<col />
</colgroup>
<thead
class="t-table__header"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ exports[`BaseTable Component > props.showHeader: BaseTable contains element \`th
class="t-table--layout-fixed"
>
<colgroup>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col />
<col />
<col />
</colgroup>
<thead
class="t-table__header"
Expand Down Expand Up @@ -168,15 +162,9 @@ exports[`BaseTable Component > props.size is equal to large 1`] = `
class="t-table--layout-fixed"
>
<colgroup>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col />
<col />
<col />
</colgroup>
<thead
class="t-table__header"
Expand Down Expand Up @@ -323,15 +311,9 @@ exports[`BaseTable Component > props.size is equal to medium 1`] = `
class="t-table--layout-fixed"
>
<colgroup>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col />
<col />
<col />
</colgroup>
<thead
class="t-table__header"
Expand Down Expand Up @@ -478,15 +460,9 @@ exports[`BaseTable Component > props.size is equal to small 1`] = `
class="t-table--layout-fixed"
>
<colgroup>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col />
<col />
<col />
</colgroup>
<thead
class="t-table__header"
Expand Down Expand Up @@ -782,15 +758,9 @@ exports[`BaseTable Component > props.tableLayout is equal to fixed 1`] = `
class="t-table--layout-fixed"
>
<colgroup>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col
style="min-width: 80px;"
/>
<col />
<col />
<col />
</colgroup>
<thead
class="t-table__header"
Expand Down
8 changes: 3 additions & 5 deletions packages/components/table/_example/fixed-header-col.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import { Table, Radio, Checkbox, Space, Tag, Link } from 'tdesign-react';
import { ErrorCircleFilledIcon, CheckCircleFilledIcon, CloseCircleFilledIcon } from 'tdesign-icons-react';
import { CheckCircleFilledIcon, CloseCircleFilledIcon, ErrorCircleFilledIcon } from 'tdesign-icons-react';
import { Checkbox, Link, Radio, Space, Table, Tag } from 'tdesign-react';

import type { TableProps } from 'tdesign-react';

Expand All @@ -19,7 +19,6 @@ for (let i = 0; i < 20; i++) {
index: i,
applicant: ['贾明', '张三', '王芳'][i % 3],
status: i % 3,
channel: ['电子签署', '纸质签署', '纸质签署'][i % 3],
detail: {
email: ['w.cezkdudy@lhll.au', 'r.nmgw@peurezgn.sl', 'p.cumx@rampblpa.ru'][i % 3],
},
Expand All @@ -42,7 +41,7 @@ export default function TableFixedColumn() {
footData={[{}]}
tableLayout={tableLayout}
tableContentWidth={tableLayout === 'fixed' ? undefined : '1600px'}
maxHeight={fixedTopAndBottomRows ? 500 : 300}
maxHeight={500}
fixedRows={fixedTopAndBottomRows ? [2, 2] : undefined}
columns={[
{ colKey: 'applicant', title: '申请人', width: '100', foot: '共20条', fixed: 'left' },
Expand All @@ -65,7 +64,6 @@ export default function TableFixedColumn() {
);
},
},
{ colKey: 'channel', title: '签署方式' },
{ colKey: 'matters', title: '申请事项', width: '150', foot: '-' },
{ colKey: 'detail.email', title: '邮箱地址' },
{ colKey: 'createTime', title: '申请日期', width: '120', foot: '-' },
Expand Down
Loading
Loading