reactable
reactable copied to clipboard
Can details take both row and column argument ?
Hello, looking at the doumentation I see in
?reactable
details: Additional content to display when expanding a row. An R function that takes the row index and column name as arguments, or a ‘JS()’ function that takes a row info object as an argument. Can also be a ‘colDef()’ to customize the details expander column.
However when I try to pass 2 arguments the second argument is worth ".details", is that expected ?
data <- unique(CO2[, c("Plant", "Type")])
reactable(data, details = function(index, column) {
browser()
plant_data <- CO2[CO2$Plant == data$Plant[index], ]
htmltools::div(style = "padding: 1rem",
reactable(plant_data, outlined = TRUE)
)
})
What I am hoping to achieve is a table where each cell would contain a table itelf. FYI each cell within a column would contain a table with a fixed set of columns but different number of rows.