Reputation: 71
Is it possible to set color in the caption of a DT table in an html document?
I've tried with
datatable(table,
caption = paste0('<span style="color:#FF8700">Title one<span style="color:#000000">'),
rownames=FALSE)
but without results.
any idea?
Upvotes: 7
Views: 3616
Reputation: 84599
You can do in this way:
datatable(head(iris),
caption = htmltools::tags$caption("hello", style="color:red"),
rownames=FALSE)
If you want to mix several styles:
datatable(head(iris),
caption = htmltools::tags$caption(htmltools::tags$span("hello", style="color:red;"), htmltools::tags$span("how are you", style="color:blue;")),
rownames=FALSE)
Upvotes: 9