Skip to content

Commit c85b4ad

Browse files
authored
fix formatting of repr html with images (#95)
1 parent 47e076c commit c85b4ad

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pyroll/core/repr.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,12 @@ def _repr_html_(self):
7272
plt.close(plot)
7373
svg = sio.getvalue()
7474

75-
svg = re.sub(r'height="[\d.\w]*?"', 'height="100%"', svg)
76-
svg = re.sub(r'width="[\d.\w]*?"', 'width="100%"', svg)
77-
78-
return "<table><tr><td style='width:60%'>" + svg + "</td><td>" + table + "</td></tr></table>"
75+
return (
76+
"<table>"
77+
+ "<tr><td style='text-align: center'>" + svg + "</td></tr>"
78+
+ "<tr><td style='text-align: left'>" + table + "</td></tr>"
79+
+ "</table>"
80+
)
7981

8082
except (NotImplementedError, ImportError, AttributeError, TypeError):
8183
return table

0 commit comments

Comments
 (0)