inside a list are injected into to the preceeding tag
html = []
html.append(f'')
+
+ num_rows = 0
for row in rows:
if isinstance(row, List):
if len(row) > 0 and any(row):
@@ -25,10 +27,14 @@ def nested_html_table(rows: List[Union[str, List[Optional[str]], None]], table_a
html.append(f' | {cell} | '.replace('> ')
html.append(' | ')
+ num_rows = num_rows + 1
elif row is not None:
html.append(' | ')
html.append(f' {row}')
html.append(' |
')
+ num_rows = num_rows + 1
+ if num_rows == 0: # empty table
+ html.append(' |
') # generate empty cell to avoid GraphViz errors
html.append('')
return html