How to Increase the Cell Width of Jupyter/IPython Notebook in Your Browser
Jupyter/IPython notebooks are a popular tool among data scientists for developing, documenting, and sharing their work. One common issue that arises when working with these notebooks is the default cell width, which can often be too narrow, making it difficult to read or write long lines of code.
In this blog post, I’ll walk you through several methods to increase the cell width of Jupyter/IPython notebooks in your browser. This will help you to improve readability and make the most out of your screen real estate.
Table of Contents
Method 1: Create a Custom CSS File
Another way to increase cell width in Jupyter notebooks is by creating a custom CSS file. This method allows you to set the cell width for all notebooks globally. To do this, follow these steps:
Initial Jupyter cell width
- Locate the Jupyter configuration directory on your system. You can do this by running the following command in your terminal or command prompt:
- In the configuration directory, create a subdirectory called
customif it doesn’t already exist.
- Inside the
customdirectory, create a new file named
custom.cssin your favorite text editor, and add the following CSS code:
width: 100% !important;
- Save the file and restart your Jupyter notebook server.
Now, all your Jupyter notebooks will have their cell width set to 100% of the available screen width.
Method 2: Use Browser Developer Tools
A quick and temporary way to increase cell width in a Jupyter notebook is by using your browser’s developer tools. This method is useful if you just need to make a quick change and don’t want to modify any files. Here’s how to do it:
- Open your Jupyter notebook in your browser.
- Right-click on the cell you want to modify and select
Inspect Element, depending on your browser.
- In the developer tools window, locate the
- Modify the
widthproperty to your desired value, such as
This method only applies the changes to the current notebook session, and the changes will be lost when you refresh the page or close the browser.
In this blog post, we’ve covered two methods to increase the cell width of Jupyter/IPython notebooks in your browser. Give one or more of these methods a try to improve readability and make the most out of your screen real estate. Happy coding!
About Saturn Cloud
Saturn Cloud is your all-in-one solution for data science & ML development, deployment, and data pipelines in the cloud. Spin up a notebook with 4TB of RAM, add a GPU, connect to a distributed cluster of workers, and more. Join today and get 150 hours of free compute per month.