The accepted answer suggests to modify the raw data for presentation purposes, something you generally do not want. Certain CSS classes are attached to cells. If table_styles is given as a dictionary each key should be a specified column or index value and this will map to specific class CSS selectors of the given column or row. You can modify the formatting of individual columns in data frames, in your case: For your information '{:,.2%}'.format(0.214) yields 21.40%, so no need for multiplying by 100. The placeholder is defined using curly brackets: {}. Each of these can be specified in two ways: A call to one of the .set_ or .hide_ methods, e.g. .set_caption or .hide_columns. When using Styler.apply(func, axis=None), the function must return a DataFrame with the same index and column labels. These are styles that apply to the table as a whole, but don’t look at the data. Note that Styler.set_table_styles will overwrite existing styles but can be chained by setting the overwrite argument to False. selector is the CSS selector that props will apply to. This code would allow you to compute a summary, format the table using percentages, and apply a backgrouned gradient to a table: (df.pipe(PrettyPandas).as_percent(precision=0).median().style.background_gradient()) 4.1.3Formatting Numbers Notice also that our function returned a string containing the CSS attribute and value, separated by a colon just like in a