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

Add last header cell class #390

Merged
merged 2 commits into from
Dec 2, 2019
Merged
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
1 change: 1 addition & 0 deletions src/TableHeaderRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function TableHeaderRow({
[`${prefixCls}-align-${column.align}`]: !!column.align,
[`${prefixCls}-row-cell-ellipsis`]: !!column.ellipsis,
[`${prefixCls}-row-cell-break-word`]: !!column.width,
[`${prefixCls}-row-cell-last`]: i === row.length - 1,
});
return (
<HeaderCell {...cellProps} {...customProps} key={column.key || column.dataIndex || i} />
Expand Down
30 changes: 15 additions & 15 deletions tests/__snapshots__/Table.expandRow.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports[`Table.expand controlled by expandedRowKeys 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -127,7 +127,7 @@ exports[`Table.expand controlled by expandedRowKeys 2`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -241,7 +241,7 @@ exports[`Table.expand expand all rows by default 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -354,7 +354,7 @@ exports[`Table.expand expand row by click 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -454,7 +454,7 @@ exports[`Table.expand expand rows by defaultExpandedRowKeys 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -554,7 +554,7 @@ exports[`Table.expand renders a custom icon 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -657,7 +657,7 @@ exports[`Table.expand renders expand icon as cell 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -744,7 +744,7 @@ exports[`Table.expand renders expand icon to the specify column 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -831,7 +831,7 @@ exports[`Table.expand renders expand row correctly 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -918,7 +918,7 @@ exports[`Table.expand renders expend row class correctly 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -1027,7 +1027,7 @@ exports[`Table.expand renders fixed column correctly 1`] = `
Age
</th>
<th
class="rc-table-fixed-columns-in-body"
class="rc-table-fixed-columns-in-body rc-table-row-cell-last"
>
Gender
</th>
Expand Down Expand Up @@ -1115,7 +1115,7 @@ exports[`Table.expand renders fixed column correctly 1`] = `
>
<tr>
<th
class=""
class="rc-table-row-cell-last"
>
Name
</th>
Expand Down Expand Up @@ -1184,7 +1184,7 @@ exports[`Table.expand renders fixed column correctly 1`] = `
>
<tr>
<th
class=""
class="rc-table-row-cell-last"
>
Gender
</th>
Expand Down Expand Up @@ -1249,7 +1249,7 @@ exports[`Table.expand renders nested data correctly 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down Expand Up @@ -1336,7 +1336,7 @@ exports[`Table.expand renders tree row correctly 1`] = `
Name
</th>
<th
class=""
class="rc-table-row-cell-last"
>
Age
</th>
Expand Down
6 changes: 3 additions & 3 deletions tests/__snapshots__/Table.fixedColumns.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ exports[`Table.fixedColumns renders correctly 1`] = `
title11
</th>
<th
class="rc-table-fixed-columns-in-body rc-table-row-cell-break-word"
class="rc-table-fixed-columns-in-body rc-table-row-cell-break-word rc-table-row-cell-last"
>
title12
</th>
Expand Down Expand Up @@ -620,7 +620,7 @@ exports[`Table.fixedColumns renders correctly 1`] = `
title1
</th>
<th
class="rc-table-row-cell-break-word"
class="rc-table-row-cell-break-word rc-table-row-cell-last"
>
title2
</th>
Expand Down Expand Up @@ -814,7 +814,7 @@ exports[`Table.fixedColumns renders correctly 1`] = `
>
<tr>
<th
class="rc-table-row-cell-break-word"
class="rc-table-row-cell-break-word rc-table-row-cell-last"
>
title12
</th>
Expand Down
Loading