Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

align jupyter notebook tables to the left

When I create a simple table in Jupyter Notebooks, the table appears in the center of the cell. What do I have to do to align that table to the left instead of center?

Sample Latex Table for Jupyter:

| This | is   |
|------|------|
|   a  | table|

Thank you

like image 327
code base 5000 Avatar asked Dec 13 '22 21:12

code base 5000


1 Answers

When creating a table and assigning it the float: left attribute you end up having to add more CSS to resolve the text that surrounds the table. Place this in a code cell before your markdown cell

%%html
<style>
    table {
        display: inline-block
    }
</style>

However, if you have a lot of CSS, might be best to put it in another file for the overall beauty of the document.

like image 183
sometimes24 Avatar answered Feb 12 '23 14:02

sometimes24