R Gurus,
I am struggling with a unique problem with adding an icon in front of certain column names in a reactable.
library(htmltools)
library(dplyr)
library(tippy)
data <- as_tibble(mtcars[1:6, ], rownames = "car") %>%
select(car:hp)
# See the ?tippy documentation to learn how to customize tooltips
with_tooltip <- function(value, tooltip, ...) {
div(style = "text-decoration: underline; text-decoration-style: dotted; cursor: help",
tippy(value, tooltip, ...))
}
reactable(
data,
columns = list(
mpg = colDef(header = with_tooltip("mpg", "Miles per US gallon")),
cyl = colDef(header = with_tooltip("cyl", "Number of cylinders"))
)
)
In this example, I would like to add icon("circle-question")
in front of mpg and cyl columns.
I tried to add class="fa fa-circle-question"
or icon("circle-question")
at various places but could not find a solution. Any help would be much appreciated.