| 1557 | |
| 1558 | |
| 1559 | def _html_table(obj, showindex="default"): |
| 1560 | obj = _tabulate( |
| 1561 | obj, headers="keys", tablefmt="html", floatfmt=".2f", showindex=showindex |
| 1562 | ) |
| 1563 | obj = obj.replace(' style="text-align: right;"', "") |
| 1564 | obj = obj.replace(' style="text-align: left;"', "") |
| 1565 | obj = obj.replace(' style="text-align: center;"', "") |
| 1566 | obj = _regex.sub("<td> +", "<td>", obj) |
| 1567 | obj = _regex.sub(" +</td>", "</td>", obj) |
| 1568 | obj = _regex.sub("<th> +", "<th>", obj) |
| 1569 | obj = _regex.sub(" +</th>", "</th>", obj) |
| 1570 | return obj |
| 1571 | |
| 1572 | |
| 1573 | def _download_html(html, filename="quantstats-tearsheet.html"): |