[BUG] merge_duplicate_headers breaks style_cell_conditional
@T4rk1n ci sta già lavorando.
Dal 3/6/2025.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
There were earlier bugs report regarding merge_duplicate_headers Issue1877 and it seems like there are still some left. I am not yet at 3.x but i found nothing regarding this in the changelog
dash 2.18.2
dash-bootstrap-components 1.2.1
dash-core-components 2.0.0
dash-extensions 1.0.1
dash-html-components 2.0.0
dash-table 5.0.0
Describe the bug
Wrong black bold lines when using merge_duplicate_headers and style_cell_conditional.
Expected behavior
No bold black lines in the wrong columns.
Minimal Example
import dash
from dash import Dash, dash_table, html
import pandas as pd
# Sample data
data = {
'Group A': ['Alice', 'Bob'],
'Group A.1': [10, 20],
'Group B': ['X', 'Y'],
'Group B.1': [100, 200],
'Group B.2': [1.1, 2.2]
}
# Create DataFrame
df = pd.DataFrame(data)
# Define columns with headers as lists for multi-level headers
columns = [
{'name': ['Name', 'Person'], 'id': 'Group A'},
{'name': ['Name', 'Score'], 'id': 'Group A.1'},
{'name': ['Details', 'Code'], 'id': 'Group B'},
{'name': ['Details', 'Value 1'], 'id': 'Group B.1'},
{'name': ['Details', 'Value 2'], 'id': 'Group B.2'},
]
# Define style for bold black borders
style_cell_conditional = [
{
'if': {'column_id': col},
'borderRight': '5px solid black',
'fontWeight': 'bold'
} for col in ['Group A.1', 'Group B.1'] # Columns to highlight
]
# Dash app
app = Dash(__name__)
app.layout = html.Div([
dash_table.DataTable(
data=df.to_dict('records'),
columns=columns,
merge_duplicate_headers=True,
style_cell={'textAlign': 'center'},
style_cell_conditional=style_cell_conditional
)
])
if __name__ == '__main__':
app.run_server(debug=True)
- Lingua principale
- Python
- Stelle
- 24.4k
- Fork
- 2.3k
- Merge medio
- 2g 7h
- PR unite (30g)
- 13
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plotly/dash
-
good first issue P3 size: 1 task
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
enhancement P3 size: 10+
-
P2 size: 1 task
-
enhancement P3 size: 1
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
-
bug P2 size: 5
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
bancolombia/sentinel#23 ·
-
test md ApertaCI
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100