Hi guys,
I would like to create a datatable with the last column being a html.A Element with a button.
Is there a simple way like the dropdown feature (Dropdowns Inside DataTable | Dash for Python Documentation | Plotly) to simply declare a column as a button or checkbox or anything else?
Where can I find the possibilities to use with columns (id, dropdown, editable, etc.)
import dash
import dash_table
import pandas as pd
import dash_html_components as html
from flask import Flask
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.csv')
server = Flask(__name__)
app = dash.Dash(server=server)
buttons = {
index: html.Div(style={'height': 100, 'width': '100%'},
children=(
html.A(id='a-fileserver',
children=[html.Button('Fileserver', id='fileserver-button-{}'.format(index), n_clicks=0)],
target='_blank',
href=value,
style={'display': 'inline-block',
'padding-right': '2%'})
)
)
for value, index in df["Generation (GWh)"].iteritems()
}
app.layout = dash_table.DataTable(
id='table',
columns=[{"name": i, "id": i} for i in df.columns],
data=df.to_dict('records'),
)
if __name__ == '__main__':
app.run_server(debug=True)
Thank you,
Felix