Rezi
    Preparing search index...

    Function distributeColumnWidths

    • Distribute available width among table columns.

      Algorithm:

      1. Assign fixed widths to columns with explicit width
      2. Calculate remaining space after fixed columns
      3. Distribute remaining space to flex columns proportionally
      4. Apply min/max constraints to flex columns
      5. Redistribute overflow from constrained columns

      Type Parameters

      • T

      Parameters

      • columns: readonly Readonly<
            {
                align?: "center"
                | "left"
                | "right";
                flex?: number;
                header: string;
                key: string;
                maxWidth?: number;
                minWidth?: number;
                render?: (value: unknown, row: T, index: number) => VNode;
                sortable?: boolean;
                width?: number;
            },
        >[]

        Column definitions

      • availableWidth: number

        Total available width in cells

      Returns ColumnWidthResult

      Column widths and total width