Hello, all. In my app I have a download button that I made using a html.Button
within a html.A
component, but no matter what I do, I cannot figure out how get the resulting button to inherit the look of the other buttons within the html.Div
they are all under.
To structure and neatly organize all of my components, I use css-grid-layout
(mozilla has a good intro), and a nice side-effect of using it in a Div
is that all the html.Button
's placed within it gain a rectangular sharp look. I would like to figure out how to get my download link to also inherit this look. Would anyone care to lend me any advice on this?
MWE:
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash(dev_tools_hot_reload=True)
app.scripts.config.serve_locally = True
app.config['suppress_callback_exceptions'] = True
app.layout = html.Div(children=[
html.H2('MWE', style={'font-size':'26px'}),
html.Div(children=[
html.Label("Input Var's",
style={'grid-row':'1 / 2', 'grid-column':'1 / 2'}),
dcc.Input('Input', type='text',
style={'grid-row':'2 / 3', 'grid-column':'1 / 2'}),
html.Label('# of Inputs',
style={'grid-row':'1 / 2', 'grid-column':'2 / 3'}),
dcc.Input(id='Random 1', value=10, type='number',
style={'grid-row':'2 / 3', 'grid-column':'2 / 3'}),
html.Label('Random 2',
style={'grid-row':'1 / 2', 'grid-column':'3 / 4'}),
dcc.Input(id='Random 3', value=10, type='number',
style={'grid-row':'2 / 3', 'grid-column':'3 / 4'}),
html.Button(id='Button 1', children='Button 1',
style={'grid-row':'2 / 3', 'grid-column':'4 / 5'}),
html.Button(id='Button 2', children='Button 2',
style={'grid-row':'2 / 3', 'grid-column':'5 / 6'}),
html.A(html.Button(children='Save Button', id='table_download_button',
style={'grid-row':'2 / 3', 'grid-column':'6 / 7'}),
id='table_download_link',
download="raw_tweet_data.csv",
href="",
target="_blank"),
],
style={'display':'grid', 'grid-template-rows':'25px 25px 25px 25px',
'grid-auto-columns': '100px 100px 100px 100px 140px 140px '}
)
])
mport dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash(dev_tools_hot_reload=True)
app.scripts.config.serve_locally = True
app.config['suppress_callback_exceptions'] = True
app.layout = html.Div(children=[
html.H2('MWE', style={'font-size':'26px'}),
html.Div(children=[
html.Label("Input Var's",
style={'grid-row':'1 / 2', 'grid-column':'1 / 2'}),
dcc.Input('Input', type='text',
style={'grid-row':'2 / 3', 'grid-column':'1 / 2'}),
html.Label('# of Inputs',
style={'grid-row':'1 / 2', 'grid-column':'2 / 3'}),
dcc.Input(id='Random 1', value=10, type='number',
style={'grid-row':'2 / 3', 'grid-column':'2 / 3'}),
html.Label('Random 2',
style={'grid-row':'1 / 2', 'grid-column':'3 / 4'}),
dcc.Input(id='Random 3', value=10, type='number',
style={'grid-row':'2 / 3', 'grid-column':'3 / 4'}),
html.Button(id='Button 1', children='Button 1',
style={'grid-row':'2 / 3', 'grid-column':'4 / 5'}),
html.Button(id='Button 2', children='Button 2',
style={'grid-row':'2 / 3', 'grid-column':'5 / 6'}),
html.A(html.Button(children='Save Button', id='table_download_button',
style={'grid-row':'2 / 3', 'grid-column':'6 / 7'}),
id='table_download_link',
download="raw_tweet_data.csv",
href="",
target="_blank"),
],
style={'display':'grid', 'grid-template-rows':'25px 25px 25px 25px',
'grid-auto-columns': '100px 100px 100px 100px 140px 140px '}
)
])
if __name__ == '__main__':
app.run_server(debug=True)
if __name__ == '__main__':
app.run_server(debug=True)