Font in a gt table not working an in Rshiny app

...
Font changes to a gt table are being reflected when we run the following code

 mtcars%>%
          head()%>%
          gt()%>%
          opt_table_font(
            font="Georgia"
  )

working font

However, when the same thing is run using an R shiny app, then the font are not reflected correctly

library(shiny)
library(gt)

ui <- fluidPage(
  gt_output("table")
)

server = function(input, output, session) {
  
  output$table <- gt::render_gt({

    data<-mtcars%>%
      head()%>%
      gt()%>%
      opt_table_font(
        font="Georgia"
      
  )

  } 
  )

}

shinyApp(ui, server)

Nonworking font

seems to be tension between the bootstrap css that fluidpage loads in and the way gt sets the font.
this can be demonstrated by omitting the fluidpage wrapper

ui <- gt_output("table")

solutions might be to write a bespoke css file, or perhaps worth raising with the gt developers so that they can consider if they can address it in their code.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.