Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When exporting an ipython notebook to html, long output doesn't have a scroll bar

I have an iPython notebook with some very long output cells, which automatically get a scroll bar when editing the live notebook. When I convert to HTML with

ipython nbconvert myfile.ipynb

everything looks fine except that the long output cells don't have a scroll bar. If I manually edit the HTML and add the output_scroll class to the cells, the scroll bar appears.

Is this the expected behaviour? I thought that nbconvert to HTML was supposed to preserve scroll behaviour.

like image 200
mojones Avatar asked Jul 29 '15 12:07

mojones


People also ask

How do you get the scrollbar in Jupyter Notebook?

You can try Cell -> Current Outputs -> Toggle Scrolling in the Jupyter UI to enable the scrolling for the output of one cell.

How do you view full length output in Jupyter Notebook?

To show the full data without any hiding, you can use pd. set_option('display. max_rows', 500) and pd.

How do you view full output in Jupyter Notebook without scrolling?

If you want all the cells to display long outputs without scrolling, then go to the Cell tab -> All Outputs -> Toggle Scrolling .

How to scrap HTML in iPython notebook?

Scraping and Rendering HTML in iPython Notebook Requirements: You need to have to have seleniuminstalled first: run pipinstallseleniumin the terminal or with iPython run !pipinstallselenium. Getting an HTML selection with selenium First, set up a Firefox webdriver and point it to our URL of interest.

Is it possible to read raw HTML in iPython notebook?

Reading raw HTML isn’t very nice. Let’s take advantage of some iPython Notebook magic: since we’re viewing the notebook in a web browser, we can also render HTML content directly in the notebook.

Can I use relative links in HTML in iPython notebook?

Here is the same table as above, rendered in HTML in the iPython notebook. Relative links won’t work, but in the example below the image of the ISS shows up correctly because its srcis an absolute link.


1 Answers

Until now, it still hasn't that ability. I suggest that change manually at

 <div class=".."> to 
 <div class=".."style="overflow-y: scroll; height:400px;">

Maybe because of it doesn't know which fields long/short

like image 174
Nguyễn Tuấn Anh Avatar answered Sep 18 '22 22:09

Nguyễn Tuấn Anh