缩小DT :: dataTableOutput大小 [英] Shrink DT::dataTableOutput Size
本文介绍了缩小DT :: dataTableOutput大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的界面闪亮,我经常使用 DT :: dataTableOutput
和 DT :: renderDataTable
。但是,我想知道是否有办法缩小数据表的大小,例如使字体和表变小。我应该怎么做?
I have a shiny interface, and I use DT::dataTableOutput
and DT::renderDataTable
a lot. However, I wonder if there's a way to shrink the datatable's size, e.g., making the font and the table smaller. How should I do this?
假设我有以下代码:
foo <- function(){
shinyApp(
ui = fluidPage(
DT::dataTableOutput("table")
),
server <- function(input, output) {
x <- data.frame(1:5, 2:6)
output$table <- DT::renderDataTable(x)
}
)
}
我应该添加哪些选项或标签?
What options or tags should I add?
推荐答案
尝试将宽度:75%
添加到您的<$ c $ div
的c> style 参数:
Try adding width: 75%
to your style
parameter of the div
:
div(DT::dataTableOutput("table"), style = "font-size: 75%; width: 75%")
这篇关于缩小DT :: dataTableOutput大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文