plotly / dash-table

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
420 stars 72 forks source link

Remove base tr background-color styling #469

Open OwenMatsuda opened 5 years ago

OwenMatsuda commented 5 years ago

As of right now, dash table has a default white background. In order to change that, you need to use css to modify tr (as shown below). Since style_cell and style_cell_conditional are already built into dash table and affect both td and th, modifying tr to change table styles is not needed. Thus it would make more sense to remove all background-color default styling from tr and instead migrate that over to td/th, which, from what I can tell, don't have any default background-color.

dash_table.DataTable(
    id='transparent-table',
    columns=[
        {'name': 'Input Data', 'id': 'input-data'},
        {'name': 'Input Squared', 'id': 'output-data'}
    ],
    data=[{'input-data': i, 'output-data': i*2} for i in range(11)],
    editable=True,
    css=[{
        "selector": "tr",
        "rule": "background-color: transparent !important;"
    }],
)
itsmi commented 4 years ago

How about:

        style_data={
            'backgroundColor': 'transparent'
        },