Formatting HTML titles in R

I created a table with the package reactable but I'am not sure how to format the HTML titles so they share the same style with the table, like font, colour and background color. I would like it to look like a whole thing, not like they does not fit.

This is my code:

library(reactable)
library(htmltools)

options(reactable.theme = reactableTheme(
  color = "hsl(233, 9%, 87%)",
  backgroundColor = rgb(38/255,42/255,51/255,142/240),
  borderColor = rgb(152/255,156/255,165/255,240/240)
  ))

example<- reactable(data.frame(country=c("argentina","brazil"),
                           value=c(1,2)
))

final <- htmlwidgets::prependContent(example, 
                                      list(h2(class = "title", "title 1"),
                                           h4(class = "subtitle", "subtitle")))


print(final)

What would you do?

its html/css so you either provide a seperate css file for styling and refer to it, or you do inline styling like

h2(class = "title", "title 1",style="background-color:#262A3397;color:#FFFFFF")

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.