如何在 Python Dash 中的两个 dcc 组件之间留出空间?

fun*_*all 9 python plotly plotly-dash plotly-python

Dash 中  (空格)的 HTML 等价物是什么?

html.Div(
    [
      dcc.Input(),
      <add horizontal space here> 
      dcc.Input()
    ]
)
Run Code Online (Sandbox Code Playgroud)

MrL*_*eeh 10

如果你想在组件之间添加一些空间,你可以简单地使用 CSS 属性:

html.Div(
    [
      dcc.Input(),
      dcc.Input(style={"margin-left": "15px"})
    ]
)
Run Code Online (Sandbox Code Playgroud)

这会在第二个输入的左侧添加一个边距。

查看 Plotly Dash 文档和 CSS 文档中关于边距的布局部分: