-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: add parameter to to_html for HTML border #14061
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
ENH: add parameter to to_html for HTML border #14061
Conversation
2144248
to
1e4287d
Compare
Current coverage is 85.27% (diff: 100%)@@ master #14061 diff @@
==========================================
Files 139 139
Lines 50511 50517 +6
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43071 43078 +7
+ Misses 7440 7439 -1
Partials 0 0
|
notebook : {True, False}, optional, default False | ||
Whether the generated HTML is for IPython Notebook. | ||
border : int | ||
A ``border=border`` tag is included in the opening ``<table>`` tag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really up to date on HTML nomenclature, but I think border
is probably an attribute rather than a tag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed (and in core/frame.py
too)
1e4287d
to
65c3912
Compare
@@ -371,6 +371,9 @@ display.multi_sparse True "Sparsify" MultiIndex display (don't | |||
display.notebook_repr_html True When True, IPython notebook will | |||
use html representation for | |||
pandas objects (if it is available). | |||
display.html_border 1 A ``border=value`` attribute is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would namespace this html
, as prob add more as time goes on.
Further would deprecate notebook_repr_html
and rename to html.notebook
(or maybe notebook.html=True
) (and not in the .display
space to differentiate)
65c3912
to
49e57e7
Compare
@TomAugspurger On second thought, should the option be in |
Closes #11563
Previously this was hardcoded to
<table border="1" ...>
. Now we allow an option toto_html
.The only controversial bit here may be the option. I really don't like having options control output, but given that this is essentially a repr I think it's OK. It's also the only way to expose it to the user since
_repr_html_
can't take any arguments. I also selfishly need this for my own library, where the user wouldn't be able to pass an option 😄Interestingly, the
border="0"
is seemingly redundant in the notebook:Looking at the CSS, I see jupyter applying a border-width of 0.909091px in their style, though I can't remember if I've adjusted the default CSS on this computer; will check later.