I have a rather large table, that if I fit it into the DT table and do a PDF print on it, there will be portions of the column that will be cut off. Also, I wanted to adjust the size of the title when exporting it to the PDF as well. How should I go about this?
Here's an example of what I'm talking about when all the columns don't fit into one page. How do I adjust the size of the table and the title inside the DT table PDF?
library("shiny")
library("DT")
data <- cbind(iris,iris,iris)
shinyApp(
ui = fluidPage(DT::dataTableOutput('tbl')),
server = function(input, output) {
output$tbl = DT::renderDataTable(
data,extensions="Buttons",options = list(dom = 'Bt',
buttons = list( list( extend = 'pdf',
pageSize = 'A4',
orientation = 'landscape',
filename = 'tt',
title= "A smaller title here")))
)
}
)
Several things I've tried:
capturepackage: Will print the entire table to how I adjust and format the table in Shiny, but all in one PDF page, which is not ideal since I want the PDF to be printable over several A4 pages.- Putting in a
widthargument inDTOutput: Will not show up adjusted in the PDF export table.