Skip to content

Collapse rows #601

@ratnanil

Description

@ratnanil

A feature that I'm missing in this great package is the ability to "span cells" between rows. This would be a feature similar as gt currently behaves when passing it a grouped dataframe. However, instead of adding the grouped column as an additional row, it would be cool if there was a way to merge cells with the same value, similar to the function kableExtra::collapse_rows (see way below)

Current behaviour

library(gt)
library(dplyr)

iris %>%
  group_by(Species) %>%
  sample_n(3) %>%
  gt()

image

Desired output as demonstrated with kableExtra:

library(kableExtra)

iris %>%
  group_by(Species) %>%
  sample_n(3) %>%
  kable() %>%
  collapse_rows(5)

image

PS: Issue #108 (comment) contains a link to this very feature from kableExtra, but that might be a mistake

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions