Python Bokeh TextInput在同一行中显示标题和输入框
我想将TextInput的标题与输入框内联显示,但默认情况下,它显示在两个单独的行上 下面的代码在Jupyter笔记本中创建了一个文本输入框,但它在框上方显示了标题。如何使标题显示在与输入框相同的行上Python Bokeh TextInput在同一行中显示标题和输入框,python,bokeh,Python,Bokeh,我想将TextInput的标题与输入框内联显示,但默认情况下,它显示在两个单独的行上 下面的代码在Jupyter笔记本中创建了一个文本输入框,但它在框上方显示了标题。如何使标题显示在与输入框相同的行上 from bokeh.layouts import column, row from bokeh.models.widgets import Slider, TextInput from bokeh.plotting import ColumnDataSource, figure, output_
from bokeh.layouts import column, row
from bokeh.models.widgets import Slider, TextInput
from bokeh.plotting import ColumnDataSource, figure, output_file, show, reset_output, output_notebook
reset_output()
output_notebook()
layout = row([TextInput(title='my label:', value='something')])
show(layout)
电流输出:
期望输出:
似乎没有任何设置可以更改标题位置,但您可以通过在外部小部件(如段落)上写入标题,并在TextInput中保留title参数为空来实现类似的结果:
from bokeh.layouts import column, row
from bokeh.models import Paragraph
from bokeh.models.widgets import Slider, TextInput
from bokeh.plotting import ColumnDataSource, figure, output_file, show, reset_output, output_notebook
reset_output()
output_notebook()
title_ = Paragraph(text='my label', align='center')
layout = row([title_, TextInput(title='', value='something')])
show(layout)
输出: