Jupyter Notebook nbextension Table of Contents (2) hidden behind top panel

1.2k Views Asked by At

I'm using Jupyter Notebook nbextension Table of Contents (2).

Part of the contents are hidden behind the top panel. How do I config it to make it display properly? enter image description here

I tried

from IPython.core.display import display, HTML
display(HTML("<style>.maintoolbar { margin-top: 100px; }</style>"))

But it moves my toolbar up, rather than move the ToC down. enter image description here

2

There are 2 best solutions below

0
Iman Saleh On

I found that when I slightly drag down the table of content on the LHS it solves this issue. It will still appear this way every time the notebook is loaded initially.

0
THN On

Until this issue is resolved, here are some workarounds to fix notebook nbextension toc2 bad position.

Option 1: Copy and run the following code in a notebook cell (Reference).

from IPython.display import display, HTML
display(HTML("<style>.container { width:83%; align: left; }</style>"))
display(HTML("<style>#toc-wrapper{ position: relative; width: 20%; top: 130px; left: 0px; }</style>"))

Option 2: Alternatively, click and drag anywhere in the toc sidebar area (Reference, also mentioned in other answer).