Table write_image (png) - how to delete white space around table in png

Hey community,

I figure out what can be done here:

layout = go.Layout( autosize=True, **margin={'l': 0, 'r': 0, 't': 20, 'b': 0}**)

fig = go.Figure(layout=layout, data=[go.Table(
    header=dict(values=list(a.columns),
                fill_color='paleturquoise',
                align='center'),
    cells=dict(
            values=[a[k].tolist() for k in a.columns[0:]],
            align = "center"))
                      
])

fig.show()

margin helps me to reduce this white space around my table.

Hope this helps anyone in future!

1 Like