Skip to content

Commit

Permalink
fix: fix table th nowrap
Browse files Browse the repository at this point in the history
  • Loading branch information
xiejay97 committed May 31, 2024
1 parent 10a1f90 commit 8e40a04
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/app/components/table/PC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function PC<T = any>(props: AppTableProps<T> & { grid: boolean; layout: '
ths.push(
<Table.Th
key={index}
styleOverrides={{ 'table__cell-text': { style: { whiteSpace: 'nowrap' } } }}
width={column.width}
sort={column.thProps?.sort}
action={column.thProps?.action}
Expand All @@ -67,7 +68,7 @@ export function PC<T = any>(props: AppTableProps<T> & { grid: boolean; layout: '
tds.push((data, dataIndex) => (
<Table.Td
key={index}
styleOverrides={{ 'table__cell-text': { style: { overflowWrap: column.nowrap ? 'normal' : undefined } } }}
styleOverrides={{ 'table__cell-text': { style: { whiteSpace: column.nowrap ? 'nowrap' : undefined } } }}
width={column.width}
fixed={fixed}
align={column.align}
Expand Down Expand Up @@ -110,7 +111,11 @@ export function PC<T = any>(props: AppTableProps<T> & { grid: boolean; layout: '
)}
{ths}
{actionOpts && (
<Table.Th width={actionOpts.width} fixed={{ top: 0, right: 0 }}>
<Table.Th
styleOverrides={{ 'table__cell-text': { style: { whiteSpace: 'nowrap' } } }}
width={actionOpts.width}
fixed={{ top: 0, right: 0 }}
>
{t('components.table.ACTIONS')}
</Table.Th>
)}
Expand Down

0 comments on commit 8e40a04

Please sign in to comment.