In Jupyter Notebook, when we print the output table of our data, it shows a very basic table containing the data. But what if we want to customize this default style? In this article, we will see how we can add styles to our output data table.
This is how a default data table looks like in Jupyter Notebook:
Now let’s try to change the style. We can do it by the set_table_styles method of pandas module.
Now we need to pass the ‘selectors’ and ‘props’ as argument to this method, i.e. we need to select the CSS tags of the table (eg: th, td etc) and change the values of their properties (eg: background, font-color, font-family etc).
So, if we need to change the font-family of the text in the data section of the table, we can do it like this:
Let’s try to add more changes and see the output.
We can also hide the index column by
- Install Python package using Jupyter Notebook
- Using Matplotlib with Jupyter Notebook
- Getting started with Jupyter Notebook | Python
- Jupyter notebook Tips and Tricks
- How To Use Jupyter Notebook - An Ultimate Guide
- How to install Jupyter Notebook in Windows?
- How to install Jupyter Notebook in Linux?
- Jupyter notebook VS Python IDLE
- Markdown cell in Jupyter notebook
- Difference Between Jupyter and Pycharm
- Python - Notebook in GTK+ 3
- Add a Pandas series to another Pandas series
- Add a new column in Pandas Data Frame Using a Dictionary
- Python | Pandas Series.add()
- Python | Pandas dataframe.add()
- Add a row at top in pandas DataFrame
- Python | Pandas Panel.add()
- Add, subtract, multiple and divide two Pandas Series
- How to add Empty Column to Dataframe in Pandas?
- Add column names to dataframe in Pandas
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.