Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable highlighting of active cell in DashTable

Tags:

plotly-dash

How can I stop the active cell (the cell clicked on last) being highlighted in a dash datatable?

enter image description here

like image 782
Dave Anderson Avatar asked May 29 '19 14:05

Dave Anderson


1 Answers

This can be achieved by inheriting the background color and border when the cell is selected using conditional styling when creating the data table:

style_data_conditional=[
    {
        "if": {"state": "selected"},
        "backgroundColor": "inherit !important",
        "border": "inherit !important",
    }
]

Alternatively, you should be able to achieve this by adding a custom CSS file into the assets folder of your project. How to do this is explained in the Dash forum.

I have completely removed the highlighting by setting values to transparent.

.dash-spreadsheet-container .dash-spreadsheet-inner table {
        border-collapse: collapse;
        font-family: monospace;
        --accent: transparent  !important;
        --border: transparent !important;
        --text-color: transparent !important;
        --hover: transparent !important;
        --background-color-ellipses: transparent !important;
        --faded-text: transparent !important;
        --faded-text-header: transparent !important;
        --selected-background: transparent !important;
        --faded-dropdown: transparent !important;
        --muted: transparent !important;
    }

like image 124
EdH Avatar answered Oct 06 '22 19:10

EdH