menu

Questions & Answers

How to resize the scrolling output height in jupyterlab notebook?

Is there a way to resize the scrolling output height in jupyterlab notebooks ?

potential solutions but require HTML/CSS knowledge

  1. I found this snippet from this question resize ipython notebook output window useful but it wont work on jupyterlab

    from IPython.core.display import display, HTML
    display(HTML("<style>div.output_scroll { height: 44em; }</style>"))
    
  2. I found this CSS snippet here Jupyterlab active scroll bars for long results which can be included using stylus. It works to make the scrolling output smaller but for some reason doesn't work to make it larger than the default height

    .jp-OutputArea-child {
     max-height: 15em;
    }
    

Note the scrolling output am talking about can be achieved by right clicking + enable scrolling for output

Main issue:

when am working with jupyterlab notebooks I sometimes have very long outputs, and so I would right clicking + enable scrolling for output. Then the output is folded however I would like to resize that scrolling output (see figure below)

Make the output cell bigger in terms of height

I am using jupyterlab version 2.2.9

Note, i am aware of the following and they don't work for me:

  • sidecar extension
  • create new view for output functionality
Comments:
2023-01-21 00:10:06
Could you provide an example of dummy long output that causes this issue and your JupyterLab version?
2023-01-21 00:10:06
@krassowski just did that.
Answers(1) :

The first snippet you posted can be modified to the following to work with JupyterLab (tested with version 3.1.18):

from IPython.display import display, HTML
display(HTML("<style>.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea { max-height: 44em; }</style>"))

The value of 44em can be adjusted as you desire to increase the visible area more or less.