Column

Column(
    self,
    name=None,
    aggregate=None,
    sortable=None,
    resizable=None,
    filterable=None,
    searchable=None,
    filter_method=None,
    show=None,
    default_sort_order=None,
    sort_na_last=None,
    format=None,
    cell=None,
    grouped=None,
    aggregated=None,
    header=None,
    footer=None,
    details=None,
    html=None,
    na=None,
    row_header=None,
    min_width=None,
    max_width=None,
    width=None,
    align=None,
    v_align=None,
    header_v_align=None,
    sticky=None,
    class_=None,
    style=None,
    header_class=None,
    header_style=None,
    footer_class=None,
    footer_style=None,
    id=None,
    type=None,
    _selectable=False,
)

Configure a table column.

Parameters

Name Type Description Default
name str | None The name to display in the header. None
aggregate Literal['mean', 'sum', 'max', 'min', 'median', 'count', 'unique', 'frequency'] | JsFunction | None Aggregate function to use when rows are grouped. The name of a built-in aggregate function or a custom JS() aggregate function. Built-in aggregate functions are: “mean”, “sum”, “max”, “min”, “median”, “count”, “unique”, and “frequency”. To enable row grouping, use the group_by argument in Reactable(). None
sortable bool | None Whether to enable sorting. Overrides the table option. None
resizable bool | None Whether to enable column resizing. Overrides the table option. None
filterable bool | None Whether to enable column filtering. Overrides the table option. None
searchable bool | None Whether to enable global table searching for this column. By default, global searching applies to all visible columns. Set this to False to exclude a visible column from searching, or True to include a hidden column in searching. None
filter_method JsFunction | None Custom filter method to use for column filtering. A JS() function that takes an array of row objects, the column ID, and the filter value as arguments, and returns the filtered array of row objects. None
show bool | None Whether to show the column. None
default_sort_order Literal['asc', 'desc'] | None Default sort order. Either “asc” for ascending order or “desc” for descending order. Overrides the table option. None
sort_na_last bool | None Always sort missing values (e.g. None, nan, NAs) last? None
format ColFormat | ColFormatGroupBy | None Column formatting options. A ColFormat() object to format all cells, or a ColFormatGroupBy() to format standard cells (“cell”) and aggregated cells (“aggregated”) separately. None
cell JsFunctionCell | CellRenderer | None Custom cell renderer. A Python function that takes a CellInfo() object, or a JS() function that takes a cell info object and table state object as arguments. None
grouped JsFunctionCell | None Custom grouped cell renderer. A JS() function that takes a cell info object and table state object as arguments. None
aggregated JsFunctionCell | None Custom aggregated cell renderer. A JS() function that takes a cell info object and table state object as arguments. None
header JsFunctionCol | Callable[[HeaderCellInfo], HTML] | None Custom header renderer. A Python function that takes a HeaderCellInfo() object or a JS() function that takes a column object and table state object as arguments. None
footer JsFunctionCol | Callable[[ColInfo], HTML] | None Footer content or render function. Render functions can be a Python function that takes a ColInfo() object, or a JS() function that takes a column object and table state object as arguments. None
details JsFunctionRow | Callable[[RowInfo], HTML] | None Additional content to display when expanding a row. A Python function that takes a RowInfo() object, or a JS() function that takes a row info object and table state object as arguments. None
html bool | None Whether to render content as HTML. Raw HTML strings are escaped by default. None
na str | None String to display for missing values (e.g. None, nan, NAs). By default, missing values are displayed as blank cells. None
row_header bool | None Whether to mark up cells in this column as row headers. Set this to True to help users navigate the table using assistive technologies. When cells are marked up as row headers, assistive technologies will read them aloud while navigating through cells in the table. Cells in the row names column are automatically marked up as row headers. None
min_width int | None Minimum width of the column in pixels. Defaults to 100. None
max_width int | None Maximum width of the column in pixels. None
width int | None Fixed width of the column in pixels. Overrides min_width and max_width. None
align Literal['left', 'right', 'center'] | None Horizontal alignment of content in the column. One of “left”, “right”, “center”. By default, all numbers are right-aligned, while all other content is left-aligned. None
v_align Literal['top', 'center', 'bottom'] | None Vertical alignment of content in data cells. One of “top” (the default), “center”, “bottom”. None
header_v_align Literal['top', 'center', 'bottom'] | None Vertical alignment of content in header cells. One of “top” (the default), “center”, “bottom”. None
sticky Literal['left', 'right'] | None Make the column sticky when scrolling horizontally. Either “left” or “right” to make the column stick to the left or right side. If a sticky column is in a column group, all columns in the group will automatically be made sticky, including the column group header. None
class_ list[str] | Callable[[CellInfo], list[str]] | JsFunctionCell | None Additional CSS classes to apply to cells. Multiple classes should be specied as a single string with a space separating each class. If a list is passed, the first entry sets the class for the first cell, and so on. Can also be a Python function that takes a CellInfo() object, or a JS() function that takes a row info object, column object, and table state object as arguments. None
style CssRules | Callable[[ColEl], dict[str, str]] | None Inline styles to apply to cells. A named list or character string. Can also be a Python function that takes the cell value, or a JS() function that takes a row info object, column object, and table state object as arguments. None
header_class list[str] | None Additional CSS classes to apply to the header. None
header_style CssStyles | None Inline styles to apply to the header. A named list or character string. None
footer_class list[str] | None Additional CSS classes to apply to the footer. None
footer_style CssRules | None Inline styles to apply to the footer. A named list or character string. None
id str | None This is currently used internally, and should not be set by the user. None