Skip to contents

The colDef_minwidth function generates column definitions with a minimum width for specified columns in a Reactable table. It creates column definitions based on provided column names and the desired minimum width.

Usage

colDef_minwidth(cols, width)

Arguments

cols

A character vector specifying the column names for which the minimum width column definitions are to be generated.

width

An integer specifying the minimum width for the specified columns.

Value

A list of column definitions suitable for use in a Reactable table.

Examples

mtcars %>%
  rownames_to_column("cars") %>%
  reactable(
    defaultColDef = colDef(footerStyle = list(fontWeight = "bold")),
    columns = combined_named_lists(
      colDef_minwidth(cols = c("mpg", "cyl"), width = 300)
    )
  )
#> Error in map(item_list, names): could not find function "map"