自动滚动到数据的右侧
有什么方法可以在R Shiny中以将滚动条设置为从数据呈现的滚动条时自动在渲染时(即到最后一列)将滚动条设置为右侧,而不是默认设置的左侧?
基本示例:
library(shiny)
runApp(shinyApp(
ui = fluidPage(
DT::dataTableOutput("results", width = 300)
),
server = function(input, output, session) {
output$results <- DT::renderDataTable(
mtcars,
options = list(scrollX = TRUE, bPaginate = F)
)
}
))
Is there any way, in R Shiny, to set the scroll bar from a datatable automatically to the right side when rendered (i.e. to the last column), instead of the left side as it is set by default ?
Base example :
library(shiny)
runApp(shinyApp(
ui = fluidPage(
DT::dataTableOutput("results", width = 300)
),
server = function(input, output, session) {
output$results <- DT::renderDataTable(
mtcars,
options = list(scrollX = TRUE, bPaginate = F)
)
}
))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这里编辑
是您想要的:
1000是1000ms,这是动画的持续时间。我不明白为什么 += 300还不够。
EDIT
Here is what you want:
1000 is 1000ms, this is the duration of the animation. I don't understand why +=300 is not enough.
在UI中添加此行:
tags $ style('#result {Direction {rtl;}')
Add this line in the ui:
tags$style('#results {direction: rtl;}')