R闪亮显示checkboxGroupInput水平 [英] R Shiny display checkboxGroupInput horizontally

查看:177
本文介绍了R闪亮显示checkboxGroupInput水平的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用R Shiny水平显示 checkboxGroupInput (内嵌块)?

How to display checkboxGroupInput horizontally (inline block) with R shiny?

推荐答案

您可以这样:

checkboxGroupInput(inputId="test", label="Test", choices=1:4),
tags$style(type="text/css", HTML("#test>*{float: left; margin-right: 15px; height: 20px;} #test {height: 20px;}"))

或直接编辑 css 文件,请参见 https://groups.google.com/forum/ #!topic / shiny-discuss / EMQV8NbA3MI

Or directly edit a css file, see https://groups.google.com/forum/#!topic/shiny-discuss/EMQV8NbA3MI

EDIT

由于光泽0.10.0 ,您可以将 inline 参数用于水平布局:

Since shiny 0.10.0, you can use the inline argument for horizontal layout :

library("shiny")
ui <- fluidPage(
  checkboxGroupInput(inputId="test", label="Test", choices=1:4, inline = TRUE)
)
server <- function(input, output) {

}
shinyApp(ui = ui, server = server)

这篇关于R闪亮显示checkboxGroupInput水平的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆