plotly table how to align header vertical and horizontal

Viewed 1192

i already had a look at the documentation, without success. i am looking for a solution to align the header - vertical and horizontal. the horizontal align do not work for the second row (the word "center" is not in the center). the two headers are not at the same level, is there a solution to align the vertical position?

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()

thanks for help

update: if i set the text in bold and i can fix the same level for the headers. to get the word "center" into center i use space character.

header=dict(values=['<b>this is not</b><br>   center', '<b>B Scores']

enter image description here

0 Answers
Related