# Rendering Datatable with multi-page/tab layout

**URL:** <https://community.plotly.com/t/rendering-datatable-with-multi-page-tab-layout/24707>\
**Category:** Dash Python\
**Created:** [June 17, 2019, 9:45pm UTC](https://community.plotly.com/t/rendering-datatable-with-multi-page-tab-layout/24707 "2019-06-17T21:45:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![keval](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@keval](https://community.plotly.com/u/keval)\
**Post date:** [June 17, 2019, 9:45pm UTC](https://community.plotly.com/t/rendering-datatable-with-multi-page-tab-layout/24707/1 "2019-06-17T21:45:00Z")

</div>

I am creating a dashboard with multiple tabs and each tab triggers and .py file that renders different elements of plotly objects.

Link to stackoverflow - [SO - Rendering datatable question](https://stackoverflow.com/questions/56639423/rendering-datatable-from-callback-function-dash)

For instance, my callback functions return plots, charts and I am looking to return Datatable.

Sample code:

```
layout = html.Div([

html.Div([

    dcc.Dropdown(
            id='select',
            options=[{'label': i, 'value': i} for i in List],
            value='abc',
            placeholder="xyz",
            style={'width': '100%'}

    ), 

], style={"width": "15%", "margin-left": "20%", "margin-right": "35%"}), 

html.Div([

    dash_table.DataTable(

        id='my-table',
        columns=[{"name": i, "id": i} for i in df_lease.columns],

    )
])

```

])

```
@app.callback(Output('my-table', 'data'),
              [
                  Input("landlord-select", "value")
              ]
             )
def render_table(company, market):

    df_sub1 = df_lease[(df_lease['Landlord'] == company)] 

    df_sub1 = df_sub1[['UnitNo',
                       'Commencement_Date',
                       'Expiration_Date'
                       ]]

    return df_sub1.to_dict(orient='records')

```

My question is, how can I accomplish this with Datatable. In this code, I am using `import plotly.graph_objs as go` to return graph objects. How would one go about doing something similar for returning datatable.

Note: I am able to do this go.Table as shown in the example, but DataTable is newer and offers an enhanced user experience.

Any help/pointers would be much appreciated.

---

<div class="post-metadata">

**Author:** ![keval](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@keval](https://community.plotly.com/u/keval)\
**Post date:** [June 19, 2019, 11:43pm UTC](https://community.plotly.com/t/rendering-datatable-with-multi-page-tab-layout/24707/2 "2019-06-19T23:43:39Z")

</div>

@chriddyp would you be willing share thoughts on this? I noticed a bunch of threads on this, similar issues, when working with dash\_table\_experiments. Curious, if this was fixed in the dash-table. Thanks!
