[ad_1]
My shiny application holds a table of 20-50 rows, and the users requested a fixed header.
After adding the fixed header we have scrolling issues though, if you scroll down +/- 5 lines it pops you back up to the top and this just keeps repeating.
I set my datatable up as follows:
DT::datatable(data,
caption = htmltools::tags$caption(style="caption-side: top; text-align: center; color:orange; font-size:200% ;",'Order Acceptance Requests'),
rownames = FALSE,
extensions = c("FixedHeader"),#, "Scroller"),
options = list(paging = FALSE,
searching = FALSE,
columnDefs = ColSorting,
#deferRender = TRUE,
autoWidth = TRUE,
ordering = TRUE,
info = FALSE,
fixedHeader = TRUE,
#scroller = TRUE,
ScrollY = "200px",
pageLength = -1
))
I’ve tried playing around with Scroller but it doesn’t help me solve it (or I haven’t figured out how to solve it using Scroller).
I know that there used to be compatibility issues, but according to https://datatables.net/download/compatibility it should now work together.
[ad_2]