user8902946
user8902946

Reputation: 1

R Shiny DT::renderDataTable ...how to customize title in downloaded table

I am using following code for datatable...

output$table <- DT::renderDataTable({ datatable(data = filtered_data3(), extensions = 'Buttons', options = list(pageLength = 50, dom = 'Bfrtip', buttons = c('copy', 'csv','excel', 'pdf', 'print')), rownames = FALSE) })

when I am downloading the table I'm getting "plotly-logomark" in title. How can I get rid of that and get desired title on the downloaded table. Thanks in advance

Upvotes: 0

Views: 2507

Answers (1)

St&#233;phane Laurent
St&#233;phane Laurent

Reputation: 84529

Try:

datatable(
  filtered_data3(),
  extensions = 'Buttons',
  options = list(
    pageLength = 50,
    dom = 'Blfrtip',
    buttons = list(
      list(extend = 'copy', title = "My custom title"), 
      list(extend = 'csv', title = "My custom title"), 
      list(extend = 'excel', title = "My custom title"), 
      list(extend = 'pdf', title = "My custom title"), 
      list(extend = 'print', title = "My custom title") 
    )
  )
)

Upvotes: 3

Related Questions