0

When running the following code in Jupyter Notebooks using an excel with 500 rows:

import pandas as pd
pd.set_option('display.min_rows', 50)
pd.set_option('display.max_rows', 50)
df = pd.read_excel('test.xlsx', sheet_name=0)
display(df)

I can click on the left side of the output to get a vertical scrollbar on the output window. When I export this notebook either via nbconvert or the build in "download as; HTML" I just get the 50 rows of data and no vertical scrollbar. Is there any way to keep the dataframe small (In the end I would like to show all 500 rows in an output window with a scrollbar)

HTML table in Jupyter
HTML table in export

StevenV
  • 21
  • 1
  • 3

1 Answers1

2

I managed to insert CSS with help from this blog post: http://damianavila.github.io/blog/posts/mimic-the-ipython-notebook-cell-execution.html

in this way I could insert:

overflow-y: scroll;
    max-height: 500px;

in all the output cells

StevenV
  • 21
  • 1
  • 3