-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
pandas.DataFrame.to_html()
without table border
and tr style
#22692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I thought we had issues for these, but couldn't find any on a quick search. Broadly agreed with you, just need to make the changes backwards compatible. |
Perhaps, you saw this: https://stackoverflow.com/questions/51460112/pandas-dataframe-to-html-without-table-border-and-tr-style Anyway, I could probably work out on a patch. Should not be terribly difficult. Just let me know what is supposed to be there. I see that right now, the default behavior of So, what's your policy for making this a backward compatible change? I can read some docs, if you have a link lying around. |
Contributing docs are at http://pandas-docs.github.io/pandas-docs-travis/contributing.html For the auto-dataframe class, we'll need a new keyword like For the |
I don't think a new keyword is really needed, as long as the old one defaults to something transparent. And then the user may decided what to have with it. As far as the The problem is definitely how to make sure not to break current code. In other projects I saw that issuing a warning in-between version was their way to go, so perhaps we could have a two-step where at first explicit If |
By old one, you mean
to be clear: there are two discussions to be had.
For now, I'd be happy to see 1 fixed. I'm less sure about changing the defaults. |
I am realizing that
Then perhaps a good path towards
could be: df.to_html(classes='', border='', justify='unset') There are a few BUT though:
Also, I am not quite sure how to document this behavior, but the code and the tests should be more or less ready. I can prepare a PR anytime. |
I would favor
Yes probably. I'm not really familiar with the justification code. |
The following code produces HTML code for the corresponding table:
Specifically, you get:
However, both
border
andstyle
tags are actually visualization details that should be left for the CSS. The expected behavior should be that the produced HTML should be: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 forclasses
,border
andjustify
should be:classes='dataframe'
(orclasses=('dataframe',)
),border=1
,justify='right'
.(Just tested on the
master
branch).The text was updated successfully, but these errors were encountered: