Datatable how to scroll X (horizontal)

You can do horizontal scroll. For example:
xBbNLH96Yg

import dash
import dash_html_components as html
import dash_table

app = dash.Dash(__name__)

app.layout = html.Div([
    dash_table.DataTable(
        columns=[{
            'name': 'Column {}'.format(i),
            'id': 'column-{}'.format(i)
        } for i in range(1,15)],
        data=[
            {'column-{}'.format(i): (j + (i-1)*5) for i in range(1, 15)}
            for j in range(5)
        ],
        style_table={'overflowX': 'scroll'},
    )], style={'width':500})

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

See the documentation here https://dash.plot.ly/datatable/sizing, it mentions Horizontal Scroll.

3 Likes