[英]Setting width and height in formattableOutput() in R shiny
嘗試通過水平和垂直方向滾動來修復 R shiny 中格式化表 output 的高度和重量。 然而,它在兩個方向上都溢出了。
將格式化表格包含在寬度為 4 的框中的任何方式。
library( shiny ) ; library( shinydashboard ) ; library( formattable )
runApp(shinyApp(
ui=(fluidPage(
titlePanel("data frame"),
mainPanel(
fluidRow(
box( title = 'Data 2', status = 'success', collapsible = T, width = 4, solidHeader = T,
column( 12, formattableOutput( 'data_2_ouput' ) )
)
)
)
)),
server = (function(input, output) {
output$data_2_ouput = renderFormattable({
formattable( mtcars,
list(`Indicator Name` = formatter( 'span', style = ~style( color = 'grey', font.weight = 'bold' ) ),
area() ~ color_tile( "#DeF7E9", "#71CA97" ) ) )
})
})))
我剛剛找到了解決方案。 添加此樣式選項即可完成工作。
column( 12, renderReactable( 'data_1_ouput' ), style = "height:500px; overflow-y: scroll;overflow-x: scroll;" )
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.