Replies: 1 comment 1 reply
-
JS is the only way for now, but it's not too bad. It's just that row grouping and aggregation is done completely in JavaScript, so there's not a great way to style them from pure R. There's not a very specific example of styling aggregated rows, but there is an example of styling nested rows within a row group: https://glin.github.io/reactable/articles/cookbook/cookbook.html#borders-between-groups-of-data The same approach can be used for aggregated rows, where data <- MASS::Cars93[4:8, c("Type", "Price", "MPG.city", "DriveTrain", "Man.trans.avail")]
reactable(
data,
groupBy = "Type",
columns = list(
Price = colDef(aggregate = "max"),
MPG.city = colDef(aggregate = "mean", format = colFormat(digits = 1)),
DriveTrain = colDef(aggregate = "unique"),
Man.trans.avail = colDef(aggregate = "frequency")
),
rowStyle = JS("function(rowInfo) {
if (rowInfo.level === 0) {
return { background: 'red' }
}
}"),
defaultExpanded = TRUE
) Also, |
Beta Was this translation helpful? Give feedback.
-
In reactable theme, I thought that
rowGroupStyle
would work, but it doesn't.I am wondering if I am missing something.
Relates to #250
Possibly this, but would like to avoid JS #129
https://albert-rapp.de/posts/28_reactable_intro/28_reactable_intro.html
Beta Was this translation helpful? Give feedback.
All reactions