关于Oracle 数据库有哪些书值得推荐
最满意答案
根据DT手册选项,与某些扩展相关联的选项需要放在命名列表中。 如果指定options属性中的
options
,则必须指定NULL
。datatable(.,extensions=list("ColReorder" = NULL, "ColVis" = NULL, "FixedColumns"=list(leftColumns=2))
由于
dom
属性不足而生成另一个错误。 有关详细信息, 请参阅此链接 。dom
每个字母都与表输出的指定元素相关联。 与extension
相关联的大写字母和与表格元素相关的小写字母(R
-Col R eorder,C
- C olVis,T
-Table T ools,t
- t able,i
-table i nfo等)。 如果示例'R'缺失,因此Col R eorder无法工作。 使用TableTools将所有代码放在正确的代码下面:iris %>% datatable( extensions = list("ColReorder" = NULL, "ColVis" = NULL, "TableTools" = NULL, "FixedColumns" = list(leftColumns=2)), options = list(autoWidth=TRUE, oColReorder = list(realtime=TRUE), oColVis = list(exclude=c(0, 1), activate='mouseover'), oTableTools = list( sSwfPath = "//cdnjs.cloudflare.com/ajax/libs/datatables-tabletools/2.1.5/swf/copy_csv_xls.swf", aButtons = list("copy","print", list(sExtends = "collection", sButtonText = "Save", aButtons = c("csv","xls")))), dom = 'CRTrilftp', scrollX = TRUE, scrollCollapse = TRUE))
升级! 随着DT升级(v0.1.56)扩展,
TableTools
和ColVis
不再可用。 根据上面的新教程 ,扩展可以通过buttons
扩展。 新版本的软件包更加一致,添加扩展程序比以前更容易:DT:::datatable( iris, escape=F, filter = "top", rownames= F, extensions = list("ColReorder" = NULL, "Buttons" = NULL, "FixedColumns" = list(leftColumns=1)), options = list( dom = 'BRrltpi', autoWidth=TRUE, lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), ColReorder = TRUE, buttons = list( 'copy', 'print', list( extend = 'collection', buttons = c('csv', 'excel', 'pdf'), text = 'Download' ), I('colvis') ) ) )
According to the DT manual options associated with some extensions needs to be placed in a named list. If one specifies options in
options
attribute, thenNULL
must be assigned.datatable(.,extensions=list("ColReorder" = NULL, "ColVis" = NULL, "FixedColumns"=list(leftColumns=2))
Another error is generated due to insufficient
dom
attribute. For more info see this link . Each letter indom
is linked with specified element of table output. Uppercase letters associated withextension
and lowercase with table elements (R
- ColReorder,C
- ColVis,T
- TableTools,t
- table,i
- table info etc.). In case example 'R' is missing, and therefore ColReorder couldn't work. Putting all together below correct code with TableTools added:iris %>% datatable( extensions = list("ColReorder" = NULL, "ColVis" = NULL, "TableTools" = NULL, "FixedColumns" = list(leftColumns=2)), options = list(autoWidth=TRUE, oColReorder = list(realtime=TRUE), oColVis = list(exclude=c(0, 1), activate='mouseover'), oTableTools = list( sSwfPath = "//cdnjs.cloudflare.com/ajax/libs/datatables-tabletools/2.1.5/swf/copy_csv_xls.swf", aButtons = list("copy","print", list(sExtends = "collection", sButtonText = "Save", aButtons = c("csv","xls")))), dom = 'CRTrilftp', scrollX = TRUE, scrollCollapse = TRUE))
Upgrade! As DT has upgraded (v0.1.56) extensions
TableTools
andColVis
is no longer available. According to the new tutorial above extension are possible throughbuttons
extension. New version of package is more consistent and adding extensions is easier than before:DT:::datatable( iris, escape=F, filter = "top", rownames= F, extensions = list("ColReorder" = NULL, "Buttons" = NULL, "FixedColumns" = list(leftColumns=1)), options = list( dom = 'BRrltpi', autoWidth=TRUE, lengthMenu = list(c(10, 50, -1), c('10', '50', 'All')), ColReorder = TRUE, buttons = list( 'copy', 'print', list( extend = 'collection', buttons = c('csv', 'excel', 'pdf'), text = 'Download' ), I('colvis') ) ) )
相关问答
更多-
如何在DT :: datatable中设置多个选项列表和扩展名(How to set multiple option list and extensions in DT::datatable)[2021-04-06]
根据DT手册选项,与某些扩展相关联的选项需要放在命名列表中。 如果指定options属性中的options ,则必须指定NULL 。 datatable(.,extensions=list("ColReorder" = NULL, "ColVis" = NULL, "FixedColumns"=list(leftColumns=2)) 由于dom属性不足而生成另一个错误。 有关详细信息, 请参阅 ... -
如何使水平滚动条在DT :: datatable中可见(How to make the horizontal scrollbar visible in DT::datatable)[2023-05-14]
如果你不需要,你可以(或者应该)轻松地强制滚动条,但上面的代码对我来说工作正常,它在页面初始化时显示一个滚动条。 也许问题出在数据或其他方面。 这是一个在页面加载时具有水平滚动条的最小示例 runApp(shinyApp( ui = fluidPage( DT::dataTableOutput("results", width = 300) ), server = function(input, output, session) { output$results <- DT::r ... -
关于桌子本身没有任何东西可用。 只有当它们用于显示而不是表达表格数据时,它才是问题。 你有表格数据,它恰好有2列。 仅仅因为它是一个2列6行的表格并不意味着它看起来像一个。 http://jsfiddle.net/hgWxT/ table, tbody { display: block; } tr { display: inline-block; width: 30%; } td, th { display: block; }