I have code as following in shiny
DT::renderDataTable({
df()
, rownames=FALSE
,extensions = c('Responsive', 'Buttons')
, options = list(
# dom = 'C<"clear">T<"clear">lfrtip'
# , tableTools=list(sSwfPath = copySWF('www'))
dom = 'Bfrtip'
, buttons = c('pageLength'
, 'colvis'
, 'pdf')
, orientation ='landscape'
, lengthMenu = list(c(6, 12, 18, -1), c('6', '12', '18', 'All'))
, pageLength = 12
)
)
}
})
I want to download pdf in landscape. How should I do it.
According to following link: https://datatables.net/reference/button/pdf that we can pass orientation as landscape. However, I am not able to do it.
I have tried following:
DT::renderDataTable({
df()
, rownames=FALSE
,extensions = c('Responsive', 'Buttons')
, options = list(
# dom = 'C<"clear">T<"clear">lfrtip'
# , tableTools=list(sSwfPath = copySWF('www'))
dom = 'Bfrtip'
, buttons = c('pageLength'
, 'colvis'
, list(extend: 'pdf', orientation='landscape')
, orientation ='landscape'
, lengthMenu = list(c(6, 12, 18, -1), c('6', '12', '18', 'All'))
, pageLength = 12
)
)
}
})
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…