我目前正在开发一个闪亮的应用程序,我使用
rhandsontable
包来显示表格。这是我正在使用的代码:
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)
我想要有粘性的列和行名称,但我不确定如何在不使用框的情况下实现此目的(这就是为什么我设置了非常大的height
和
width
)。我尝试了几种方法,但似乎都不起作用。任何意见都会被采纳。
(colHeaders = TRUE)
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 = 500, width = 800) %>%
hot_table(stickyRows = TRUE,
colHeaders = TRUE)
})
}
shinyApp(ui = ui, server = server)