align jupyter notebook tables to the left

Viewed 10991

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

3 Answers

Align tables only for markdown output:

Jupyter & Jupyter Lab:

%%html
<style>
    /* Jupyter */
    .rendered_html table,
    /* Jupyter Lab*/
    div[data-mime-type="text-markdown"] table {
        margin-left: 0
    }
</style>

Put this code once on the top of notebook in Code cell

Related