widget - IPython/Jupyter 对齐小部件

标签 widget alignment ipython jupyter

我一直在使用 Jupyter 小部件,但在对齐方面遇到了问题,例如,我有下一个小部件:

from IPython.html import widgets as wdg

#Two Sliders
s1 = wdg.IntSlider(min=0,max=100,value=25,description='Xo')
s2 = wdg.IntSlider(min=0,max=100,value=25,description='Yo')

#Three Float Text 
c1 = wdg.BoundedFloatText(min=0,max=100,value=5,description='C1 ')
c2 = wdg.BoundedFloatText(min=0,max=100,value=5,description='C2 ')
c3 = wdg.BoundedFloatText(min=0,max=100,value=5,description='C3 ')

#Two Checkbox
ch1 = wdg.Checkbox(description='Check me 1')
ch2 = wdg.Checkbox(description='Check me 2')

#Containers
Con1 = wdg.HBox(children=[s1,s2])
Con2 = wdg.HBox(children=[c1,c2,c3])
Con3 = wdg.HBox(children=[ch1,ch2])
Con5 = wdg.Box(children=[Con1,Con2,Con3])

Con5 的输出中, c1 , c2c3都在一起, float 框之间没有空间,所以它们的描述是重叠的,我该怎么做才能使它们居中,或者至少增加它们之间的空间?

最佳答案

我确认“边距”影响垂直和水平间距。

c1.margin=20
c2.margin=20
c3.margin=20

关于widget - IPython/Jupyter 对齐小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29086892/

相关文章:

javascript - 有没有办法自定义 tradingview 代码小部件?

css - 无法将我的下拉菜单与下拉按钮对齐(更多)

c++ - 如果它们是 16 字节对齐的,是否可以将 float 直接转换为 __m128?

python - 在 jupyter notebook 中使用 λ,φ,α,...,就像在 julia 中一样

python - 以编程方式创建 jupyter 4 笔记本?

facebook - 如何将 facebook 评论小部件链接到当前 url?

python - 在 IPython Notebook 中使用 Interact Widgets 渲染延迟

javascript - Dashboard Widget 首选项实际保存在哪里?

css - 如何使用 bootstrap 3 将字形图标居中放置在圆圈内

html - 禁用 Jupyter 键盘快捷键