# Datatable on dropdown menu

**URL:** https://community.plotly.com/t/datatable-on-dropdown-menu/36301
**Category:** Dash Python
**Created:** [March 17, 2020, 4:09am UTC](https://community.plotly.com/t/datatable-on-dropdown-menu/36301 "2020-03-17T04:09:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![angelo](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@angelo](https://community.plotly.com/u/angelo)
#### Post date: [March 17, 2020, 4:09am UTC](https://community.plotly.com/t/datatable-on-dropdown-menu/36301/1 "2020-03-17T04:09:15Z")

</div>

Hi there, it’s now 5 days since I m trying to understand how the hec can I add a datatable to a dropdown subtab.

This is where I m up to now (obvisouly not working…)

thanks Angelo

```auto
app.layout = html.Div(style={'backgroundColor': colors['background']},children=[
    html.H1(children='STOCK SCREENER -DASHBOARD',
            style={'textAlign': 'left', 'colour': colors['text']}),
    
    dcc.Interval(id='refresh', interval=200,),
    dcc.Input(id='input', value='input stock code', type='text', placeholder="stock code"),
    

    dcc.Tabs(id="tabs", value='tab', children=[
        
        dcc.Tab(label='SNAPSHOT', value='tab-1', style=TAB_STYLE,selected_style=SELECTED_STYLE, children=[
            html.Div(id='example-graph')]),
        
                 
        dcc.Tab(label='KEY STATS', value='tab-2',style=TAB_STYLE,selected_style=SELECTED_STYLE, children=[
            dcc.Dropdown(id='subtab-2', multi=True, options=[{'label': 'Key Stats', 'value': 'A'},
                                                 {'label': 'Key Stats Comparison', 'value': 'B'}])]),
        
        dcc.Tab(label='FINANCIALS', value='tab-3',style=TAB_STYLE,selected_style=SELECTED_STYLE,children=[
            dcc.Dropdown(id='subtab-3', options=[
                                                {'label': 'Balance Sheet', 'value': 'C'},
                                                dash_table.DataTable( id= 'datatable1', columns=[{"name": i, "id": i} for i in df_balance_sheet],
                                               data=df_balance_sheet.to_dict('records'))],
                        
            

                                                {'label': 'Income Statement', 'value': 'D'},
                                                {'label': 'Cash Flow', 'value': 'E'}],
                         
                                               )]),

```

---

<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 17, 2020, 1:44pm UTC](https://community.plotly.com/t/datatable-on-dropdown-menu/36301/2 "2020-03-17T13:44:34Z")

</div>

Hi @angelo, the options of a `dcc.Dropdown` have to have plain text strings for their value key, you cannot have a DataTable as an option of the dropdown. Do you want each row of your dataframe to appear as an option of the dataframe or do you want the whole table to appear in the dropdown (I don’t think this is possible, but if you give us more details about what you want to do we can try to suggest workarounds)?

---

<div class="post-metadata">

### Author: ![angelo](https://avatars.discourse-cdn.com/v4/letter/a/41988e/32.png) [@angelo](https://community.plotly.com/u/angelo)
#### Post date: [March 17, 2020, 11:53pm UTC](https://community.plotly.com/t/datatable-on-dropdown-menu/36301/3 "2020-03-17T23:53:38Z")

</div>

Hi Emmanuelle,  
I have partially and roughly achieved having a dataframe in one of the dropdown options.

What I m trying to achieve is having a multi-dropdown where , for each ‘label’ in options I have a different output content; so in my case I would like to have a data table.

I have seen this few times but not able to implement it into my script.

thks for your help
