diff --git a/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx b/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx index cedc0bd7f..dc859a55d 100644 --- a/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx +++ b/packages/common/business_components/src/ui/table/HeadMakeColSpan.tsx @@ -12,41 +12,53 @@ interface TableUpperProps { const HeadMakeColSpan = ({ upHeadList }: { upHeadList: TableUpperProps[] }) => { const maxRow = upHeadList.reduce((max, head) => Math.max(max, head.row || 0), 0); - return ( - <> - {Array.from({ length: maxRow + 1 }, (_, rowIndex) => ( - + + if(maxRow == 0){ + return ( + <> + {upHeadList.map((head: TableUpperProps) => { - if (head.row === rowIndex) { - return ( - - {head.title} - - ); - }else{ - return ( - - {head.title} - - ); - } - })} + return ( + + {head.title} + + ); + })} - ))} - - ); + + ); + }else{ + return ( + <> + {Array.from({ length: maxRow + 1 }, (_, rowIndex) => ( + + {upHeadList.map((head: TableUpperProps) => { + if (head.row === rowIndex) { + return ( + + {head.title} + + ); + } + })} + + ))} + + ); + } + } export { HeadMakeColSpan }; diff --git a/packages/common/business_components/src/ui/table/index.tsx b/packages/common/business_components/src/ui/table/index.tsx index ae4960a03..45748fb37 100644 --- a/packages/common/business_components/src/ui/table/index.tsx +++ b/packages/common/business_components/src/ui/table/index.tsx @@ -13,7 +13,7 @@ type UiTableProps = { onPageChange: (page: number) => void; className?: string; resetPageNo?: boolean; - children: React.ReactNode | undefined; + children?: React.ReactNode | undefined; } type UiHeadProps = {