我似乎不能让我的小部件来换行文本。
这段代码:
import ipywidgets as widgets
test_layout = widgets.Layout(
border='1px solid black',
flex_flow = 'row wrap',
width = '200px')
test_string = 'test test test test test test test test test test'
test_label = widgets.Label(value = test_string, layout=test_layout)
test_label
输出:
我遗漏了什么?我试过很多不同的方法,但都不管用!
发布于 2020-04-13 00:38:23
我也有同样的问题。我使用了一个HTML小部件,如下所示:
import ipywidgets as widgets
widget = widgets.HTML(value= '<style>p{word-wrap: break-word}</style> <p>'+ [variable containing long text goes here] +' </p>')
发布于 2021-06-18 21:21:45
您可以增加width = '400px')
https://stackoverflow.com/questions/58405678
复制相似问题