Tables with jupyter formatting

Github repo

Jupyter notebooks have really nice table formatting (it doesn't come from pandas). Is there a way to export a pandas table to image, in the style of Jupyter notebook, to .svg, and without any external libaries? Yes.

Why?

The Formatting is easy to emulate in .svg, after all it's just rectangles, lines, and text. For an example see the below - it's not a screenshot of a rendered pandas dataframe, but is an .svg file made to look like the same thing.

The code in the repo above can process any dataframe in this way, with no external libraries required.

P.S. why .svg? It's the natural choice for a table - it's high (infinite) resolution, low file size, and supports text highlighting. Also it's just a bunch of rectangles, lines, and text, just like a table.