summaryrefslogtreecommitdiff
path: root/components/client-data-table
diff options
context:
space:
mode:
Diffstat (limited to 'components/client-data-table')
-rw-r--r--components/client-data-table/data-table.tsx11
1 files changed, 7 insertions, 4 deletions
diff --git a/components/client-data-table/data-table.tsx b/components/client-data-table/data-table.tsx
index 9ea44775..44168bd2 100644
--- a/components/client-data-table/data-table.tsx
+++ b/components/client-data-table/data-table.tsx
@@ -203,7 +203,8 @@ export function ClientDataTable<TData, TValue>({
onScroll={handleScroll} // ๐ŸŽฏ ์Šคํฌ๋กค ์ด๋ฒคํŠธ ํ•ธ๋“ค๋Ÿฌ ์ถ”๊ฐ€
>
<UiTable
- className="[&>thead]:sticky [&>thead]:top-0 [&>thead]:z-10 table-fixed">
+ className="[&>thead]:sticky [&>thead]:top-0 [&>thead]:z-10">
+ {/* table-fixed ์ œ๊ฑฐ: nested header์—์„œ ๋™์  width ๋ณ€๊ฒฝ์„ ์œ„ํ•ด ์œ ์—ฐํ•œ ๋ ˆ์ด์•„์›ƒ ์‚ฌ์šฉ */}
<TableHeader>
{table.getHeaderGroups().map((headerGroup) => (
<TableRow key={headerGroup.id} className={compactStyles.headerRow}>
@@ -221,7 +222,9 @@ export function ClientDataTable<TData, TValue>({
className={compactStyles.header}
style={{
...getPinnedStyle(header.column, true), // ๐ŸŽฏ ํ—ค๋”์ž„์„ ๋ช…์‹œ
- width: header.getSize() // ๐ŸŽฏ width ๋ณ„๋„ ์„ค์ •
+ // ๋ถ€๋ชจ ๊ทธ๋ฃน ํ—ค๋”๋Š” colSpan์œผ๋กœ ๋„ˆ๋น„๊ฐ€ ๊ฒฐ์ •๋˜๋ฏ€๋กœ width ์„ค์ •ํ•˜์ง€ ์•Š์Œ
+ // ์ž์‹ ํ—ค๋”๋งŒ ๊ฐœ๋ณ„ width ์„ค์ •
+ ...(!('columns' in header.column.columnDef) && { width: header.getSize() }),
}}
>
<div style={{ position: "relative" }}>
@@ -232,8 +235,8 @@ export function ClientDataTable<TData, TValue>({
header.getContext()
)}
- {/* ๋ฆฌ์‚ฌ์ด์ฆˆ ํ•ธ๋“ค - ํ—ค๋”์—๋งŒ ์ถ”๊ฐ€ */}
- {header.column.getCanResize() && (
+ {/* ๋ถ€๋ชจ ๊ทธ๋ฃน ํ—ค๋”๋Š” ๋ฆฌ์‚ฌ์ด์ฆˆ ๋ถˆ๊ฐ€, ์ž์‹ ํ—ค๋”๋งŒ ๋ฆฌ์‚ฌ์ด์ฆˆ ๊ฐ€๋Šฅ */}
+ {header.column.getCanResize() && !('columns' in header.column.columnDef) && (
<DataTableResizer header={header} />
)}
</div>