Save your pandas.DataFrame to an .html file with Jupyter Notebook styles.
import pandas as pd
import df2html
df: pd.DataFrame = pd.DataFrame({
'planet': ['Earth', 'Mars'],
'link': ['https://en.wikipedia.org/wiki/Earth', 'https://en.wikipedia.org/wiki/Mars'],
'radius_km': [6371, 3390],
})
print(df2html.save(df))path2file, ref2code = df2html.save(df, styles_extended=[{'selector': '', 'props': [('font-size', '10px')]}])
print(path2file) # 'file://<path_2_file>/df.html'
print(ref2code) # 'File "<path_2_source_code>", line NN'