# Remove space under table

**URL:** <https://community.plotly.com/t/remove-space-under-table/36524>\
**Category:** 📊 Plotly Python\
**Created:** [March 22, 2020, 7:12am UTC](https://community.plotly.com/t/remove-space-under-table/36524 "2020-03-22T07:12:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zen100](https://avatars.discourse-cdn.com/v4/letter/z/4491bb/32.png) [@zen100](https://community.plotly.com/u/zen100)\
**Post date:** [March 22, 2020, 7:12am UTC](https://community.plotly.com/t/remove-space-under-table/36524/1 "2020-03-22T07:12:40Z")

</div>

Hello,  
I am producing a table in Python using the plotly package, but I am struggling with adjusting the space around the table. How do I remove unwanted space beneath my plotly table? I tried adjusting the margin sizes in layout which reduces the top, left and right margins. This has reduced the space at the top, left and right by pushing the table to the top of the container, but a lot of space still remains underneath. The purpose of removing the white space underneath is to embed the table in a HTML email with text above and below the table. Any help would be appreciated. Here’s my code:

```auto
table = go.Figure(data=[go.Table(
    header=dict(values=[['From cur.'],['To cur.'],['Table rate'],['FX rate'],['Abs. error (%)']], 
               fill_color='aliceblue',
               line_color='darkslategray', 
               align='left'),
    cells=dict(values=[exr_mismatches['From cur.'], exr_mismatches['To cur.'], exr_mismatches['Table rate'].map('{:.3f}'.format), 
                       exr_mismatches['FX rate'].map('{:.3f}'.format), exr_mismatches['Abs. error (%)'].map('{:.2f}'.format)],
                fill_color='whitesmoke',
                line_color='darkslategray',
                align='left'))
                        ])
table.update_layout(autosize=False, margin=dict(l=5, r=5, b=5, t=5), paper_bgcolor='steelblue')

```

---

<div class="post-metadata">

**Author:** ![Emmanuelle](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/emmanuelle/32/7853_2.png) [@Emmanuelle](https://community.plotly.com/u/Emmanuelle)\
**Post date:** [March 24, 2020, 11:07am UTC](https://community.plotly.com/t/remove-space-under-table/36524/2 "2020-03-24T11:07:32Z")

</div>

Hi @zen100 welcome to the forum! The parameter that needs to be changed is the `height` of the figure layout, for example

```auto
import plotly.graph_objects as go

fig = go.Figure(data=[go.Table(header=dict(values=['A Scores', 'B Scores']),
                 cells=dict(values=[[100, 90, 80, 90], [95, 85, 75, 95]]))
                     ])
fig.update_layout(height=100, margin=dict(r=5, l=5, t=5, b=5))
fig.show()

```

(`height` and `width` have default values, which do not adapt to the figure content).  
If the contents of the table change and you need to adapt the height of the figure, a workaround is described [here](https://community.plotly.com/t/dynamically-set-table-height/17343).
