2

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!

ragesz
  • 9,009
  • 20
  • 71
  • 88
  • Possible duplicate of [How do I increase the cell width of the Jupyter/ipython notebook in my browser?](http://stackoverflow.com/questions/21971449/how-do-i-increase-the-cell-width-of-the-jupyter-ipython-notebook-in-my-browser) – Ali Dec 01 '16 at 22:45

1 Answers1

2

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>
Community
  • 1
  • 1
ragesz
  • 9,009
  • 20
  • 71
  • 88
  • Hey, here's my answer based on yours, for modifying the width of the ipython notebook the user is working on, as opposed to changing the default settings for all notebooks: http://stackoverflow.com/a/34058270/625087 – tonyslowdown Dec 03 '15 at 05:07