forked from plotly/dash-recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdash-datatable-resizable-columns.py
More file actions
47 lines (39 loc) · 995 Bytes
/
dash-datatable-resizable-columns.py
File metadata and controls
47 lines (39 loc) · 995 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_table_experiments as dt
import json
import pandas as pd
import numpy as np
import plotly
app = dash.Dash()
server = app.server
app.scripts.config.serve_locally = True
app.css.config.serve_locally = True
ROWS = [
{'a': 'AA', 'b': 1},
{'a': 'AB', 'b': 2},
{'a': 'BB', 'b': 3},
{'a': 'BC', 'b': 4},
{'a': 'CC', 'b': 5},
{'a': 'CD', 'b': 6}
]
app.layout = html.Div([
dt.DataTable(
rows=ROWS,
column_widths=[50, 50],
enable_drag_and_drop=True,
row_selectable=True,
filterable=True,
sortable=True,
selected_row_indices=[],
id='datatable'
),
html.Div(id='selected-indexes'),
], className="container")
app.css.append_css({
"external_url": "https://codepen.io/chriddyp/pen/bWLwgP.css"
})
if __name__ == '__main__':
app.run_server(debug=True)