Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

row/column selectable single applies to all tables on the page #591

@alexcjohnson

Description

@alexcjohnson

Make 2 tables with row or column selectable=single - you can only select one row and one column on the page, should be one per table.

reported in https://community.plot.ly/t/multiple-dash-tables-selection-error/28802

import dash
import dash_html_components as html
import dash_table

keys = ['a', 'b', 'c']
data = [{'a': 'a', 'b': 'b', 'c': 'c'}, {'a': 'aa', 'b': 'bb', 'c': 'cc'}]

app = dash.Dash(__name__)
app.layout = html.Div([
    dash_table.DataTable(
        id='a',
        columns=[{"name": i, "id": i, "selectable": True} for i in keys],
        data=data,
        column_selectable='single',
        row_selectable='single'
    ),
    dash_table.DataTable(
        id='b',
        columns=[{"name": i, "id": i, "selectable": True} for i in keys],
        data=data,
        column_selectable='single',
        row_selectable='single'
    )
])

if __name__ == '__main__':
    app.run_server(debug=True)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions