@antadesign/table
    Preparing search index...

    Interface TableColumn<T>Unreviewed

    Settings for one column. Every field is optional.

    interface TableColumn<T> {
        width?: number;
        minWidth?: number;
        maxWidth?: number;
        header?: string | null | TableColumnHeader;
        renderCell?: (cell: TableCellContext<T>) => ReactNode;
        renderSearchedCell?: (
            cell: TableCellContext<T> & { search: TableCellSearch },
        ) => ReactNode;
        searchable?: boolean;
        searchText?: (cell: TableCellContext<T>) => string;
        cellClassName?: string;
        sorting?: boolean | TableCompare;
        pin?: "left" | "right";
    }

    Type Parameters

    • T
    Index
    width?: number

    Fixed width in pixels, clamped to minWidth and maxWidth.

    minWidth?: number

    Minimum width for a column that shares the free width. Defaults to the width inferred from the first rows.

    maxWidth?: number
    header?: string | null | TableColumnHeader

    Header text, null for a blank header, or a title with a tooltip. Defaults to the key.

    renderCell?: (cell: TableCellContext<T>) => ReactNode

    Renders the cell. Defaults to the value's text, aligned by type.

    renderSearchedCell?: (
        cell: TableCellContext<T> & { search: TableCellSearch },
    ) => ReactNode

    Renders the cell while a search runs, so the column can mark its own matches with search.mark.

    searchable?: boolean

    Whether search scans this column.

    true
    
    searchText?: (cell: TableCellContext<T>) => string

    The text this column contributes to search. Return the text the cell renders, in order. Defaults to the value's text.

    cellClassName?: string

    Class on every cell of the column.

    sorting?: boolean | TableCompare

    false turns sorting off, a function replaces the comparison. Primitive columns sort by default.

    pin?: "left" | "right"