r - 为什么在 Shiny 中列不跨页面分布?
问题描述
我认为整行是 12,所以 4 个 3 宽的列应该填满整个页面,但事实并非如此。图书馆(闪亮)
fluidPage(
mainPanel(
fluidRow(
column(3,
textInput("user_id", "User ID", width = NULL)
),
column(3,
textInput("name", "Organization name",value = "",width = NULL)
),
column(3,
textInput("address", "Address",value = "",width = NULL)
),
column (3,
textInput("zip", "Zip Code",value = "",width = NULL)
)
) #row
) #panel
) #page
解决方案
默认情况下mainPanel
有width
8 个。查看文档时可以看到:
?shiny::mainPanel
主面板(...,宽度 = 8)
width = 12
因此,您必须在mainPanel
通话中明确说明。
fluidPage(
mainPanel(
fluidRow(
column(3,
textInput("user_id", "User ID", width = NULL)
),
column(3,
textInput("name", "Organization name",value = "",width = NULL)
),
column(3,
textInput("address", "Address",value = "",width = NULL)
),
column (3,
textInput("zip", "Zip Code",value = "",width = NULL)
)
) #row
, width = 12) #panel
) #page
..应该做的伎俩。
推荐阅读
- postgresql - postgres st_dwithin 不存在
- python - 无法导入 PyAudio
- python - 对于 Python 中的 Kivy,当我形成多个小部件时,我无法在画布布局上获得颜色
- c++ - 如何使用 std::to_string 函数将 float 格式化为“x.0”
- react-native - React Native Firebase v6,setBackgroundMessageHandler 不起作用
- python - Python - 嵌套字典 - 传递给公式并计算结果的值
- c++ - 删除后驻留集大小保持不变[]
- python-3.x - 在 Elixir 中加载 Python 模块
- unity3d - 在 Unity 中无法检测到碰撞
- linux - Linux 脚本不能创建超过 1040 个目录?