Closed
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).