From 631b09172b48ec24c4f0131bc97017b87ddf0c47 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Fri, 10 Oct 2025 11:45:21 +0900
Subject: (김준회) fix: data-table 공통컴포넌트의 nested columns에 대한 child
 column의 width 오류 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/data-table/data-table-detail.tsx | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'components/data-table/data-table-detail.tsx')

diff --git a/components/data-table/data-table-detail.tsx b/components/data-table/data-table-detail.tsx
index c34f9e73..f3f09fe2 100644
--- a/components/data-table/data-table-detail.tsx
+++ b/components/data-table/data-table-detail.tsx
@@ -87,11 +87,13 @@ export function DataTableDetail<TData>({
                       data-column-id={header.column.id}
                       className={compactStyles.header}
                       style={{
-                        ...getCommonPinningStylesWithBorder({ 
-                          column: header.column, 
-                          isHeader: true 
+                        ...getCommonPinningStylesWithBorder({
+                          column: header.column,
+                          isHeader: true
                         }),
-                        width: header.getSize(),
+                        // 부모 그룹 헤더는 colSpan으로 너비가 결정되므로 width 설정하지 않음
+                        // 자식 헤더만 개별 width 설정
+                        ...(!('columns' in header.column.columnDef) && { width: header.getSize() }),
                       }}
                     >
                       <div style={{ position: "relative" }}>
@@ -102,7 +104,8 @@ export function DataTableDetail<TData>({
                             header.getContext()
                           )}
 
-                        {header.column.getCanResize() && (
+                        {/* 부모 그룹 헤더는 리사이즈 불가, 자식 헤더만 리사이즈 가능 */}
+                        {header.column.getCanResize() && !('columns' in header.column.columnDef) && (
                           <DataTableResizer header={header} />
                         )}
                       </div>
-- 
cgit v1.2.3

