Description
From my previous line comment at be80898#commitcomment-11338872. cc @takluyver @jorisvandenbossche
Because DataFrame's _repr_html_
returns hardcoded div
tag with style max-height:1000px
, if the height of DataFrame's output exceeds 1000px, it will generate a scroll bar.
First, it is unnecessary because IPython Notebook has "toggle output scrolling" feature. Second, it causes UX problem if the height of browser resolution is below 1000px (user must scroll twice: the whole page and the generated div). Third, it can't make use of "toggle output scrolling" feature (if user turn it on, it will generate nested scroll bars (worse UX)). For more detailed explanations and examples, see the steps to reproduce below.
Pandas version: 0.16.1.
Steps to reproduce:
-
Open an IPython Notebook and paste this code. It will generate an inner scroll bar because the output's height exceeds 1000px.
import pandas as pd pd.DataFrame(list(range(100)))
-
If you want to see all rows, first you should scroll the page.
-
After you reach the bottom of the generated ouput's
div
, you should scroll again the inner scroll bar.
-
If you want to toggle the IPython Notebook's "toggle output scrolling" feature, you get this.
Desired behaviors:
Solution:
Remove style property from div
tag that DataFrame's _repr_html_
returns.
Old: <div style="max-height:1000px;max-width:1500px;overflow:auto;">\n
New: <div>\n
Why should max-width
be removed as well? Because it also generates far worse UX. If you have so many columns that the horizontal scroll bar generated, you cannot scroll it. You must refresh the page to be able to scroll it.