我已经查看了文档,但没有成功。我正在寻找一种解决方案来使标题垂直和水平对齐。水平对齐不适用于第二行(单词"center"不在中心)。两个标题不在同一水平线上,有没有一种解决方案来对齐垂直位置?
import plotly.graph_objects as go
fig = go.Figure(data=[go.Table(
header=dict(values=['this is not center', 'B Scores'],
line_color='darkslategray',
fill_color='lightskyblue',
align='center'),
cells=dict(values=[[100, 100, 100, 300], # 1st column
[90, 90, 90, 270]], # 2nd column
line_color='darkslategray',
fill_color='lightcyan',
align='center'))
])
fig.update_layout(width=250, height=130)
fig.update_layout(margin=dict(l=0, r=0, t=0, b=0))
fig.show()
感谢您的帮助。
更新:如果我将文本设置为粗体,我可以为标题设置相同的级别。为了将单词“center”放置在中心位置,我使用空格字符。
header=dict(values=['<b>this is not</b><br> center', '<b>B Scores']