Data Table on callback

Hi All,

I am using dash_table to upload and show the datatable on callback.
But callback is not displaying table. Plz assist.

html.Div(dt1.DataTable(data=[{}], id=‘dftable’))

@app.callback(Output(‘dftable’, ‘data’),
[Input(‘upload-data’, ‘contents’),
Input(‘upload-data’, ‘filename’)])
def update_output(contents, filename):
df1 = parse_contents(contents, filename)
return df1.to_dict(‘rows’)


Plz assist @chriddyp

@juhipandey4 Providing the data prop is not enough to make the table display content. It also needs to be provided the columns prop to know which fields to display on each row.

For example, a minimal columns configuration:

# -*- coding: utf-8 -*-
import dash
from dash_table import DataTable

import pandas as pd

url = ''

rawDf = pd.read_csv(url)
df = rawDf.to_dict("rows"),

columns=[{"name": i, "id": i} for i in rawDf.columns]

app = dash.Dash()
app.scripts.config.serve_locally = True

app.layout = DataTable(

if __name__ == "__main__":