我希望将ipywidget函数中的一个按钮对象对齐到中心。下面是我正在使用的代码示例
bt = widgets.Button(layout=Layout(width='180px'),style =
{'description_width': '25%'})
b_config_save = widgets.Button(
description="Save",
layout=bt.layout,
style=bt.style,
button_style='primary'
)发布于 2019-03-26 12:42:15
使用如下所示的flexbox布局。
btn = widgets.Button(description="Save")
box_layout = widgets.Layout(display='flex',
flex_flow='column',
align_items='center',
width='50%')
box = widgets.HBox(children=[btn],layout=box_layout)
display(box)发布于 2019-03-25 19:37:16
尝试使用表格,也许你可以找到一些帮助here
https://stackoverflow.com/questions/55336771
复制相似问题