I am trying to format a table, such that data in each column are formatted in a style depending on their values (similar to conditional formatting in spreadsheet programs).
You can use the DataFrame to_html method, which comes with formatters argument.
An easier solution would be to surround by and , (rather than *). Note: by default this will be escaped (i.e. < becomes <) so you will need to use the escape=False argument.