Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

colGroup

Column group definitions


Description

Use colGroup() to create column groups in a table.

Usage

colGroup(
  name = NULL,
  columns = NULL,
  header = NULL,
  html = FALSE,
  align = NULL,
  headerClass = NULL,
  headerStyle = NULL
)

Arguments

name

Column group header name.

columns

Character vector of column names in the group.

header

Custom header renderer. An R function that takes the header value as an argument, or a JS() function that takes a column info object as an argument.

html

Render header content as HTML? Raw HTML strings are escaped by default.

align

Column group header alignment. One of "left", "right", "center".

headerClass

Additional CSS classes to apply to the header.

headerStyle

Inline styles to apply to the header. A named list or character string.

Note that if headerStyle is a named list, property names should be camelCased.

Value

A column group definition object that can be used to create column groups in reactable().

Examples

reactable(
  iris,
  columns = list(
    Sepal.Length = colDef(name = "Length"),
    Sepal.Width = colDef(name = "Width"),
    Petal.Length = colDef(name = "Length"),
    Petal.Width = colDef(name = "Width")
  ),
  columnGroups = list(
    colGroup(name = "Sepal", columns = c("Sepal.Length", "Sepal.Width")),
    colGroup(name = "Petal", columns = c("Petal.Length", "Petal.Width"))
  )
)

reactable

Interactive Data Tables Based on 'React Table'

v0.2.3
MIT + file LICENSE
Authors
Greg Lin [aut, cre], Tanner Linsley [ctb, cph] (React Table library), Emotion team and other contributors [ctb, cph] (Emotion library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.