Width argument in style dictionary is not really changing the size of dcc.Input component. When I change width from 0.05% to 5%, it only changes size of spaces from other components. 5% width:
0.05% width: .How can I make size of the input component same as the other dropdown components, where each takes up, say, 5% of the row?
My code:
app.layout = html.Div([
# header
html.Div([
html.H1('VaR Calculator',
style={'textAlign': 'center'}),
html.Br(),
html.P("""This application calculates VaR for given portfolio.""")],
style={'padding':10, 'fontSize':20}),
html.Div([
html.Div([
dcc.Input(
id = 'size',
type='text',
value='',
)],style={'width':'0.05%', 'display':'table-cell','padding':5, 'verticalAlign':'middle'}
),
html.Div([
dcc.Dropdown(
id='prod',
options=[{'label':p,'value':p} for p in products],
value=None,
clearable=False,
)],
style={'width':'6%', 'display':'table-cell', 'padding':5, 'verticalAlign':'middle'}),
html.Div([
dcc.Dropdown(
id='exp',
options=[{'label':e,'value':e} for e in exp],
value=None,
clearable=False,
)],
style={'width':'6%', 'display':'table-cell','padding':5, 'verticalAlign':'middle'}),
html.Div([
dcc.Dropdown(
id='delta',
options=[{'label':d,'value':d} for d in types],
value=None,
clearable=False,
)],
style={'width':'6%', 'display':'table-cell', 'padding':5, 'verticalAlign':'middle'}),
html.Div([
dcc.Dropdown(
id='method',
options=[{'label':m,'value':m} for m in methods],
value=None,
clearable=False,
)],
style={'width':'6%', 'display':'table-cell', 'padding':5, 'verticalAlign':'middle'})
], style={'verticalAlign':'middle', 'width': '30%', 'display':'table'})
])