Wrap long table headers R shiny using



I have a table with long header names. How can I auto wrap them for a table in R Shiny. Below is what I am using so far :

  output$tablep1 <-
    function() {
      prev_prod_use() %>%
        knitr::kable("html") %>%
        ) %>%
        scroll_box(width = "100%", height = "300px")


It's manual, but you can use <br/> for new lines.


I’ve used stringr:str_wrap for this before in conjunction with kable, though not in a shiny context.