0

Again, this is probably super simple, but after spending a few hours searching I am giving up. Here is the very simple code:

library(DT)

datatable(
  iris,
  class = list(stripe = FALSE),
  style = "default",
  options = list(dom = "t"))

How to make the line below the header thicker? Or in different color (e.g. red)? Or thicker AND in different color (LOL)?

I know that I can manipulate 1st row borders but this is not what I want as in my table which rows are being shown is controlled elsewhere.

Thank you!!!

AussieAndy
  • 101
  • 2
  • 11

1 Answers1

1
library(DT)

headerCallback <- c(
  "function(thead, data, start, end, display){",
  "  $('th', thead).css('border-bottom', '1px solid red');",
  "}"
)

datatable(
  iris,
  class = list(stripe = FALSE),
  style = "default",
  options = list(
    dom = "t",
    headerCallback = JS(headerCallback)
  )
)
Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225