fo: UiTable 수정

This commit is contained in:
dongsilove
2025-12-29 11:00:38 +09:00
parent 9b5025703d
commit 2ec793fd59
2 changed files with 45 additions and 41 deletions
@@ -43,6 +43,7 @@ type UiHeadProps = {
row?: number;
widthPercent?: number;
rowSpan?: number;
colSpan?: number;
};
export function UiTable({
@@ -136,13 +137,13 @@ export function UiTable({
<></>
)}
<div className={`card !p-0r !m-[1.2rem] ${className}`}>
<Table variant="secondary" className={widthFixed?"table-fixed":""}>
{widthFixed?
<colgroup>
{leafCols.map(col => (
<col key={col.id} style={{ width: col.widthPercent ? `${col.widthPercent}%` : undefined }} />
))}
</colgroup>:""}
<Table variant="secondary" className={widthFixed ? "table-fixed" : ""}>
{widthFixed ?
<colgroup>
{leafCols.map(col => (
<col key={col.id} style={{ width: col.widthPercent ? `${col.widthPercent}%` : undefined }} />
))}
</colgroup> : ""}
<TableHeader ref={headerRef} className="font-bold">
{children ? children : <HeadMakeColSpan upHeadList={headlist} />}
</TableHeader>
@@ -261,7 +262,10 @@ export function UiTable({
<TableRow>
<TableCell
colSpan={
headlist.filter((item) => item.visible != false).length
headlist.filter((item) => item.visible != false).length -
headlist.filter(
(item) => item.visible != false && item.colSpan,
).length
}
className="h-24 text-center text-gray-500"
>