-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Closed
Labels
BugIO HTMLread_html, to_html, Styler.apply, Styler.applymapread_html, to_html, Styler.apply, Styler.applymap
Milestone
Description
The following code produces HTML code for the corresponding table:
import pandas as pd
import numpy as np
df = pd.DataFrame(data=np.arange(3 * 4).reshape(3, 4))
df.to_html(classes=None, border=None, justify=None)Specifically, you get:
<table border="1" class="dataframe">
<thead>
<tr style="text-align: right;">
...However, both border and style tags are actually visualization details that should be left for the CSS. The expected behavior should be that the produced HTML should be:
<table>
<thead>
<tr>
...Besides the problem that there is no way of getting to a clean HTML, this is contradicting the Zen of Python n.2 https://www.python.org/dev/peps/pep-0020/ , where Explicit is better than implicit..
If the default output is something of values for the majority of pandas users, the default values for classes, border and justify should be: classes='dataframe' (or classes=('dataframe',)), border=1, justify='right'.
(Just tested on the master branch).
1beb, CharlesRngrd and clemens-boisseree
Metadata
Metadata
Assignees
Labels
BugIO HTMLread_html, to_html, Styler.apply, Styler.applymapread_html, to_html, Styler.apply, Styler.applymap