IPython notebook set width of notebook-panel (web-page)

10,378

Here is the solution: How do I increase the cell width of the Jupyter/ipython notebook in my browser?

<style>
.container { width:100% !important; }
</style>
Share:
10,378
ragesz
Author by

ragesz

Data scientist at Dmlab, Budapest, Hungary.

Updated on June 04, 2022

Comments

  • ragesz
    ragesz almost 2 years

    I want to set my IPython notebook's width to 2500px and I want it to be aligned left. How can I do this?

    I use this code to apply my own CSS:

    from IPython.core.display import HTML
    def css_styling():
        styles = open("./example.css", "r").read()
        return HTML(styles)
    css_styling()
    

    The content of my CSS is:

    <style>
    div #notebook { /* centre the content */
        float: left;
        width: auto;}
    div #notebook_panel { /* main background */
        float: left;
        width: auto;}
    div.cell { /* set cell width to about 80 chars */
        width: 2000px;}
    </style>
    

    If I run the the IPython script with this CSS then my notebook webpage will be aligned to left and the cell's width is 2000px but the webpage turned into horizontally scrollable at about a size 1000px. So only the first half of my cells are visible.

    If I set width: 2500px; at #notebook or at #notebook_panel then the horizontally-scrolling disappears so the notebook webpage width will be 2500px wide and I see full of my cells but the alignment will be center. Why?

    I tried it in Firefox and Chrome as well.

    Thanks for help!