【发布时间】:2014-09-08 04:12:49
【问题描述】:
我有一个使用 renderDataTable() 创建输出的闪亮示例。
我已删除所有可能的选项(分页、过滤、搜索等)。但是,我的表格输出的顶部和底部现在有一个空白行,以前是过滤和搜索的位置。
只有在删除了过滤和搜索选项后,如何才能从数据表包装器中删除这两个 div?
ui.R:
library(shiny)
shinyUI(pageWithSidebar(
headerPanel("dataTable Example"),
sidebarPanel(
"This is a sidebar"
),
mainPanel(
p("Check out the gaps below."),
wellPanel(
dataTableOutput('example1')),
p("No gaps here because of searching and paging."),
wellPanel(
dataTableOutput('example2')
)
)
)
)
服务器.R:
library(shiny)
shinyServer(function(input, output) {
x<-c(1,2,3,4,5)
y<-c('a','b','c','d','e')
test<-data.frame(x,y)
output$example1<-renderDataTable({test},options = list(iDisplayLength = 5,bSearchable = FALSE
,bFilter=FALSE,bPaginate=FALSE,bAutoWidth=TRUE
,bInfo=0,bSort=0))
output$example2<-renderDataTable({test})
})
【问题讨论】:
标签: r datatables shiny