Below is the code snippet taken from dash user guide
def generate_html_table_from_df(df):
return html.Table(
# Header
[html.Tr([html.Th(col) for col in df.columns])] +
# Body
[html.Tr([
html.Td(df.iloc[i][col], style={‘padding-top’:‘2px’, ‘padding-bottom’:‘2px’,
‘text-align’:‘right’}) for col in df.columns
]) for i in range(len(df))], style={‘border’:‘1px’, ‘font-size’:‘1.2rem’}
)
how can I add style like below in this code.
tr:hover {background-color: #f5f5f5;}
tr:nth-child(even) {background-color: #f2f2f2;}