Skip to content

Commit 2f4dc00

Browse files
committed
apply bootstrap class to pandas tables closes #110
1 parent cef7f02 commit 2f4dc00

File tree

1 file changed

+6
-2
lines changed
  • frontend-svelte/src/lib/worker

1 file changed

+6
-2
lines changed

frontend-svelte/src/lib/worker/dft.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ def _get_params(paramGeneratorDict):
3636
return {key: generator.example() for (key, generator) in paramGeneratorDict.items()}
3737

3838
def to_html(object):
39-
try:
39+
res = None
40+
if hasattr(object, 'to_html'):
41+
# the 'table' css class is used by bootstrap
42+
res = object.to_html(classes=['table'], justify="initial")
43+
elif hasattr(object, '_repr_html_'):
4044
res = object._repr_html_()
41-
except:
45+
else:
4246
res = object.__repr__()
4347
return res
4448

0 commit comments

Comments
 (0)