I am currently working on a Shiny application where I am using the rhandsontable
package to display a table. Here is the code I am using:
library(shiny)
library(rhandsontable)
ui <- fluidPage(
mainPanel(
rHandsontableOutput("myTable")
)
)
server <- function(input, output) {
output$myTable <- renderRHandsontable({
df <- data.frame(matrix(1:(50**2), ncol = 50))
rhandsontable(df, height = 10000, width = 10000)
})
}
shinyApp(ui = ui, server = server)
I would like to have sticky column and row names, but I am not sure how to achieve this without using a box (this is why I have set a very large height
and width
). I have tried several methods but none of them seem to work. Any input would be appriciated.
2
Answers
This example uses the hot_table function within the rhandsontable call to make row names sticky (stickyRows = TRUE) and include column headers (colHeaders = TRUE)
An approach based on hiding the scrollbars with CSS. You can change the width and height.