# Dash Table height issue

**URL:** <https://community.plotly.com/t/dash-table-height-issue/52876>\
**Category:** Dash Python\
**Created:** [May 12, 2021, 3:29pm UTC](https://community.plotly.com/t/dash-table-height-issue/52876 "2021-05-12T15:29:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilfin07](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@dilfin07](https://community.plotly.com/u/dilfin07)\
**Post date:** [May 12, 2021, 3:29pm UTC](https://community.plotly.com/t/dash-table-height-issue/52876/1 "2021-05-12T15:29:25Z")

</div>

Hello  
have the following code:

```auto
def interactive_table(dataframe):
    return html.Div([
        dash_table.DataTable(
            id='table',
            columns=[{"name": i, "id": i} for i in dataframe.columns],
            data=dataframe.to_dict('records'),
            style_table={'overflowX': 'auto'},
            style_cell_conditional=[{'if': {'column_id': 'ID'},
                                     'width': '20px', 'textAlign': 'center'}],
            style_cell={
                'minWidth': '98px', 'width': '98px', 'maxWidth': '120px',
                'height': '19px', 'minHeight': '19px', 'maxHeight': '19px',
                'overflow': 'hidden',
                'textOverflow': 'ellipsis',
                'textAlign': 'left'
            },

            editable=True,
            filter_action="native",
            sort_action="native",
            page_action="native",
            column_selectable="single",
            #row_selectable="multi",
            #row_deletable=True,
            selected_columns=[],
            selected_rows=[],
            # export_format="csv",
            page_current=0,
            page_size=20
        )
    ], style={'margin': '30px'})

```

I’m trying to put a specific value for the cell height but it doesn’t work, the height remains unchanged,  
please, tell me how to fix it or how to correctly set the height of the cell

Thank you

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [May 12, 2021, 5:27pm UTC](https://community.plotly.com/t/dash-table-height-issue/52876/2 "2021-05-12T17:27:02Z")

</div>

Hi @dilfin07

That code works - try running this MWE:

```auto
import dash
import dash_table
import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')

app = dash.Dash( __name__ )

app.layout = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i} for i in df.columns],
    data=df.to_dict('records'),
    style_cell={
                'minWidth': '98px', 'width': '98px', 'maxWidth': '120px',
                'height': '100px', 'minHeight': '100px', 'maxHeight': '100px',
                'overflow': 'hidden',
                'textOverflow': 'ellipsis',
                'textAlign': 'left'
            },
    style_table={'overflowX': 'auto'},
    editable=True,
    filter_action="native",
    sort_action="native",
    page_action="native",
    column_selectable="single",
    #row_selectable="multi",
    #row_deletable=True,
    selected_columns=[],
    selected_rows=[],
    # export_format="csv",
    page_current=0,
    page_size=20

)

if __name__ == ' __main__':
    app.run_server(debug=True)

```

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [May 12, 2021, 8:27pm UTC](https://community.plotly.com/t/dash-table-height-issue/52876/3 "2021-05-12T20:27:04Z")

</div>

So, I just noticed that my first example will make the cell height larger, but not smaller than 30px, which is the min for the rows. To override the min, you can add the following CSS selector:

```auto
css=[{
        'selector': '.dash-spreadsheet-inner tr',
        'rule': 'max-height: 19px; min-height: 19px; height: 19px;'
    }],

```

Here is a complete example:

```auto

import dash
import dash_table
import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')

app = dash.Dash( __name__ )

app.layout = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i} for i in df.columns],
    data=df.to_dict('records'),
    css=[{
        'selector': '.dash-spreadsheet-inner tr',
        'rule': 'max-height: 19px; min-height: 19px; height: 19px;'
    }],
    style_cell={
                'minWidth': '98px', 'width': '98px', 'maxWidth': '120px',
                'overflow': 'hidden',
                'textOverflow': 'ellipsis',
                'textAlign': 'left'
            },
)

if __name__ == ' __main__':
    app.run_server(debug=True)

```

---

<div class="post-metadata">

**Author:** ![dilfin07](https://avatars.discourse-cdn.com/v4/letter/d/cab0a1/32.png) [@dilfin07](https://community.plotly.com/u/dilfin07)\
**Post date:** [May 14, 2021, 6:23am UTC](https://community.plotly.com/t/dash-table-height-issue/52876/4 "2021-05-14T06:23:53Z")

</div>

Hello @AnnMarieW  
excellent, the solution looks like it was successful,  
perhaps, you can suggest how you can rework other elements for example, page navigation keys
