Appsilon / shiny.semantic

Shiny support for powerful Fomantic UI library.
http://appsilon.github.io/shiny.semantic
Other
497 stars 96 forks source link

semantic_DT options doesn't work[Bug]: #417

Closed ugurdar closed 6 months ago

ugurdar commented 2 years ago

Hi,

I'm trying to right justify the text in the datatable, but I can't do it even though I define it in options.

I can use formatStyle('column',` textAlign = 'center') but it affects only column body and not the header.

if (interactive()){
  library(shiny)
  library(shiny.semantic)

  ui <- semanticPage(
    semantic_DTOutput("table")
  )
  server <- function(input, output, session) {
    output$table <- DT::renderDataTable(
      semantic_DT(iris,
                  options = list(
                    columnDefs = list(
                      list(className = 'dt-right', targets = 1:3)
                      )
                    )
                  )
    )
  }
  shinyApp(ui, server)
}
esraay commented 1 year ago

Hi @ugurdar, the class name you have provided is not supported by fomanticUI. For your example, you can update the class name with "right aligned". To explore all features of fomanticUI tables you can check out https://fomantic-ui.com/collections/table.html

Also, we are progressing with some work about style and class arguments for semantic_DT in #409, after this work merges you will be able to use this 'dt-right' class without fomantic UI classes.