Skip to content

Commit dfeb5ef

Browse files
committed
simplify _table_row in notebook_integration.py
1 parent 9addcb8 commit dfeb5ef

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Diff for: adaptive/notebook_integration.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,10 @@ async def update():
233233

234234
def _table_row(i, key, value):
235235
"""Style the rows of a table. Based on the default Jupyterlab table style."""
236-
style_odd = "text-align: right; padding: 0.5em 0.5em; line-height: 1.0;"
237-
style_even = style_odd + "background: var(--md-grey-100);"
238-
template = '<tr><th style="{style}">{key}</th><th style="{style}">{value}</th></tr>'
239-
style = style_odd if i % 2 == 1 else style_even
240-
return template.format(style=style, key=key, value=value)
236+
style = "text-align: right; padding: 0.5em 0.5em; line-height: 1.0;"
237+
if i % 2 == 1:
238+
style += " background: var(--md-grey-100);"
239+
return f'<tr><th style="{style}">{key}</th><th style="{style}">{value}</th></tr>'
241240

242241

243242
def _info_html(runner):

0 commit comments

Comments
 (0)