Hi,
Today I have found something strange (for me) about data tables. Im using Dash to create simple dashboard.
As this is only one graph and quite a lot free space was still left under I had idea to put datatable with ‘raw’ data underneath.
To the point, my datatable is hiding one column without conditional formatting by stretching other column and leaving a lot of free space in each cell.
You can see on right side behind QUERY_PHRASE
Can this be related to empty cell in this line?
dash_table.DataTable(
id='hana_raw_data',
data = df_dict.to_dict('records'),
columns=[{"name": i, "id": i} for i in df_dict.columns],
fixed_rows=dict(
headers=True
),
page_size=50,
filter_action='native',
sort_action='native',
style_data=dict(
whiteSpace='normal',
height='15px',
lineHeight='15px',
padding='0px'
),
style_data_conditional=[
{
'if': {'row_index': 'odd'},
'backgroundColor': 'rgb(248, 248, 248)'
}
],
style_header={
'backgroundColor': 'rgb(230, 230, 230)',
'fontWeight': 'bold'
},
style_table=dict(
height='40vh',
overflowX='auto'
),
)
My question here.
What can I do to make last colum always visible? Is hardcoding widht for it only viable option?
Can I somehow set width for my DATETIME_ADD column to be minimal as it is needed to display whole value and still be responsive?
As my experience with python and programming in general is less than 6 month, I am thankful for all ideas that could help me solve this.