Markdown table format for Jekyll

I’m trying to generate a website from Jupyter Lab using Python and Markdown and everything goes well, with one exception: tables generated with Python end up being interpreted by Jekyll as code (thus I get an ASCII table, instead of a proper table that can be stylized with CSS). I’ve tried with PrettyTable and then tried to switch to df.to_markdown, with same results.

I think the cause for this is that the tables are exported with 4-space indentation (as seen here); hence Markdown interprets the table as code. Is there a way I could export tables without any indentation, so that Markdown could properly identify the blocks as tables and not code? Thank you!

What package is generating the tables?

It happens with both PrettyTables and Pandas DataFrames. The markdown file is generated with nbconvert.