Style inside r shiny

Hi all,
I am trying to incorporate style in the below application. Not sure why I am not getting the result. Can anyone help me?

library(shiny)
library(DT)

"<style>
  .bs-example1{
    margin: 60px;
  }
</style>"
  
ui <- fluidPage(tags$head(tags$script(src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.2.1/js.cookie.min.js")),
                tags$head(tags$script(src="app.js")
                          ),
  tabsetPanel(
    id="inTabset",
    tabPanel(class="bs-example1","Tab 1",
             dataTableOutput("table_out"))
  
)
)

server <- function(input, output, session) {
  
  output$table_out  <- DT::renderDataTable(
    datatable(
      iris,
      rownames = TRUE,
      options = list(
        fixedColumns = TRUE,
        autoWidth = TRUE,
        ordering = FALSE,
        dom = 'tB',
        buttons = c('copy', 'csv', 'excel', 'pdf')
      ),
      class = "display", #if you want to modify via .css
      extensions = "Buttons"
    )
  )
}
shinyApp(ui = ui, server = server)

https://shiny.rstudio.com/articles/css.html

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