'In' and 'Out' cells in Jupyter Notebook shifting to the right in notebook .html file

Hi

I’m currently making a Jupyter Notebook to display several bokeh plots which I have generated with a script and saved as html files.

I’ve been using iframes in python to display these plots in the notebook. While running the notebook in Jupyter, this is fine and the notebook looks as expected. However, when I download the notebook as a html file and look at that, after the first iframe the ‘in’ and ‘out’ cells start shifting to the right slightly. It looks like the left hand edge of the ‘in’ cell follows the left hand edge of the previous iframe. I can’t easily upload an image of my html file here, but this image below demonstrates the effect I’m seeing (I’ve exaggerated it to show the effect).

Over a single plot this makes little difference, but eventually this pushes all of my plots off the edge of the screen.

For references, my code for bringing in the iframe is as shown below, repeated for each of my figures with a different file name

IPython.display.HTML(<iframe scr=”figure name”, width=950, height=100></iframe)

Has anyone encountered this and know a fix?

Thank you in advance.

I cannot reproduce the problem on jupyterlab 4.5.6 with nbconvert 7.17.

What versions are you using?

Thanks for your reply. I have just checked and it’s Version 5.7.8.

This seems like a really old version of jupyter notebook you are using.

I’d try setting up a new environment with current version of jupyter notebook (if you ask me, switch to jupyterlab),

Indeed, you should be able to test this out yourself. If you took the time to set up a minimal reproducible example (see Getting good answers to your questions ) already, not something you cannot share so you make mock output in s spreadsheet(?!) you could plug this in easily to trying with more recent Jupyter, by going here and clicking ‘launch binder’ to try things out in a session on a remote virtual machine served via the MyBinder service with current tech before you even try installing it on your own machine.
Even if you don’t want to switch current interfaces, you can go here, as that will give you Jupyter Notebook and not JupyterLab.

And if you aren’t using isolated environments, make sure you are clearing things out before you install newer versions so that you don’t have possible old things hanging around causing issues.