python – Pandas styler object in Databricks loocks ugly

I am trying to make format a percentage column in pandas dataframe. Original dataframe, as outputted by Databricks

enter image description here

I want to format the color of the percentage column to depend on its contents. Also, the color depends on the index of the cell (iqr has other colour rules than HardDatefilter for instance). I did it with this piece of code (format subset is a list of columns we want to format, in this case format_subset=(‘percentage’). pdf is the dataframe.

cols = pdf.keys() if format_subset is None else format_subset
fmt = dict.fromkeys(cols,'{:.1%}')
pdf = pdf.style.format(fmt)

pdf.apply(lambda x: bg_mv_colors_vec(x, mv_relevance(x.name), dataset=dataset), axis=1 , subset=cols).apply(lambda x: fg_mv_colors_vec(x, mv_relevance(x.name),dataset=dataset), axis=1, subset=cols)

Here bg_mv_colors_vec and fg_mv_colors_vec determines the background and font color of each cell.
The output is as follows:

enter image description here

This looks super ugly, and I would like to see some borders or something.

I found the following related SO topic: Is there a quick way to turn a pandas DataFrame into a pretty HTML table?. However, this is not really a solution for my case. Databricks prints the dataframe nicely as long as it as normal dataframe, but when it is a styler object (which I need for the colorformatting) the databricks output is ugly.