A little update for those that would find this question; today Pandas is including style functions and styler objects, and this is extremely practical to achieve what you want without going through very convoluted methods. https://pandas.pydata.org/pandas-docs/stable/style.html