diff options
Diffstat (limited to 'lib/data-table.ts')
| -rw-r--r-- | lib/data-table.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/data-table.ts b/lib/data-table.ts index 4ad57d76..fd9309ab 100644 --- a/lib/data-table.ts +++ b/lib/data-table.ts @@ -20,9 +20,11 @@ import { FilterFn, Row } from "@tanstack/react-table" export function getCommonPinningStylesWithBorder<TData>({ column, withBorder = true, + isHeader = false, }: { column: Column<TData> withBorder?: boolean + isHeader?: boolean }): React.CSSProperties { const pinnedSide = column.getIsPinned() as "left" | "right" | false @@ -38,8 +40,8 @@ export function getCommonPinningStylesWithBorder<TData>({ /* ▒▒ 기타 스타일 ▒▒ */ width: column.getSize(), - // 불투명한 배경색 설정 - 테이블의 배경색과 동일하게 - background: pinnedSide ? "hsl(var(--background))" : "transparent", + // 헤더는 항상 불투명, 셀은 핀된 경우에만 불투명 + background: isHeader || pinnedSide ? "hsl(var(--background))" : "transparent", zIndex: pinnedSide ? 1 : 0, } |
