css – R DT Datatable font is automaticaly times new roman in viewer pane in R Studio

I am using the DT package in R to render a data table. Simply, the data table that is rendered is always in times new roman when viewed in the Viewer panel, and in the browser popout, which does not look good. ggplot appears correctly as Arial in the Plot panel. How can I change the font for the datatable, or change the font for everything that is rendered in the Viewer panel in R Studio. I’m happy to use CSS, but that didn’t seem to fix my problem, and I just want to understand why the default for R Studio Viewer is TNR.

enter image description here

See my code below:

library(DT)

summary <- read.csv('sample.csv')

DT::datatable(summary, extensions="Buttons", options = list(
  autoWidth = TRUE, 
  pageLength = 10,
  dom = 'Bfrtip',
  buttons = c('copy', 'csv', 'excel', 'pdf', 'print')),
  filter = list(
    position = 'top', clear = FALSE))

Read more here: Source link