7

Where can I configure Jupyter to make a DataFrame object appear as a full-bordered table by default?

Now it looks like this:

enter image description here

I wish it could look like: enter image description here

1 Answer 1

10

You can add the following code to your notebook, which will apply to all cells in the current notebook regardless of what cell it's entered in:

%%HTML
<style type="text/css">
    table.dataframe td, table.dataframe th {
        border-style: solid;
    }
</style>

If you want it to apply to all notebooks, you can add a custom config/css file. Answers on how to do that can be found here.

You might also want to explore jupyterthemes depending on how much other configuration you want to do.

Sign up to request clarification or add additional context in comments.

9 Comments

I tried this solution, but seems what it did was to remove all the line numbers in []
Can you clarify what you're looking for? I read your question as looking to get rid of the In[] and Out[]. Rereading, are you just looking to add an outer border to dataframes in the output?
Sorry about that, edited question. Basically, I want full borders around all table cells.
Thank you! It works. I also followed the instructions in the first link you provided (included at the bottom of my comment). It also works. Note: no need to restart Jupyter everytime you change the css file, just need to restart the notebook you are running. stackoverflow.com/questions/21971449/…
awesome! with border: 1px solid lightgray; tables look perfect!
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.