Your problem is most likely due to styling. I would check the external style sheet and/or theme ( if you use any). If you do not use any of them; my second “go to” would be to check the version of dash_table library. It might be the case that styling of a table was designed in that way in the earlier versions.
If you end up not finding a solution to your issue, feel free to share your full code in a reformatted text (by using </> button on top of the text input area). Unfortunately it is very hard to read your code.
hey yeah I just cleaned my code. I don’t think there’s an issue with the style as it’s just fonts and colors.
please take a look at it (I hope it’s cleaner.)
Hey, I’m getting the same buttons but I couldn’t import data-table from dash. I was getting error "ImportError: cannot import name ‘dash_table’ from ‘dash’ "
This is how I had to change the code to get it to run. I’m running it on a server and not my local machine.
import dash
import dash_html_components as html
import dash_table
from plotly.express import data
app = dash.Dash(name)
df= data.election()
app.layout = html.Div(children=[
dash_table.DataTable(
id=“table”,
columns=[{“name”: i, “id”: i} for i in df.columns],
page_size=50,
page_action=“native”,
data=df.to_dict(“records”),
#style_data_conditional=style_condition,
style_header={‘backgroundColor’: ‘#1d3557’, ‘fontWeight’: ‘bold’, ‘color’: ‘white’},
style_cell={“whiteSpace”: “normal”, “textAlign”: “center”},
style_table={“height”: “400px”, “overflowY”: “auto”},
)
])
if name == ‘main’:
app.run_server(host=‘0.0.0.0’, port=8050, debug=True)
Are you on a IDE? If yes, please check whether it uses the right python path. Alternatively, you can create a conda environment, activate it and installl your dash packages in it.