title: Pandas Styler and float_format
body: <p>Consider the example:</p>
  <pre><code>import pandas as pd
  
  pd.options.display.float_format = '{:,.3f}'.format
  
  df = pd.DataFrame.from_dict(dict(name=['a', 'b', 'c'], value=[1.1234,2.123332,3.232433]))
  print(df)
  
  df = df.style.apply(lambda x: ['background: lightgreen' if (x.name == 1) else '' for i in x], axis=1)
  print(df.to_html())
  </code></pre>
  <p>HTML output:</p>
  <pre><code>&lt;style type=&quot;text/css&quot;&gt;
  #T_fa0b6_row1_col0, #T_fa0b6_row1_col1 {
    background: lightgreen;
  }
  &lt;/style&gt;
  &lt;table id=&quot;T_fa0b6&quot;&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th class=&quot;blank level0&quot; &gt;&amp;nbsp;&lt;/th&gt;
        &lt;th id=&quot;T_fa0b6_level0_col0&quot; class=&quot;col_heading level0 col0&quot; &gt;name&lt;/th&gt;
        &lt;th id=&quot;T_fa0b6_level0_col1&quot; class=&quot;col_heading level0 col1&quot; &gt;value&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;th id=&quot;T_fa0b6_level0_row0&quot; class=&quot;row_heading level0 row0&quot; &gt;0&lt;/th&gt;
        &lt;td id=&quot;T_fa0b6_row0_col0&quot; class=&quot;data row0 col0&quot; &gt;a&lt;/td&gt;
        &lt;td id=&quot;T_fa0b6_row0_col1&quot; class=&quot;data row0 col1&quot; &gt;1.123400&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th id=&quot;T_fa0b6_level0_row1&quot; class=&quot;row_heading level0 row1&quot; &gt;1&lt;/th&gt;
        &lt;td id=&quot;T_fa0b6_row1_col0&quot; class=&quot;data row1 col0&quot; &gt;b&lt;/td&gt;
        &lt;td id=&quot;T_fa0b6_row1_col1&quot; class=&quot;data row1 col1&quot; &gt;2.123332&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;th id=&quot;T_fa0b6_level0_row2&quot; class=&quot;row_heading level0 row2&quot; &gt;2&lt;/th&gt;
        &lt;td id=&quot;T_fa0b6_row2_col0&quot; class=&quot;data row2 col0&quot; &gt;c&lt;/td&gt;
        &lt;td id=&quot;T_fa0b6_row2_col1&quot; class=&quot;data row2 col1&quot; &gt;3.232433&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  <p>When I apply a style to a row, I notice it invalidates the float_format precision that has been applied. When I dump to HTML, I see 6 digits after the decimal instead of the three. What is the correct way to fix this?</p>
  <p>I'm creating a dataframe that has a row called 'Total'. I would like this row to be highlighted only. I dump this to a HTML, and then run weasyprint to generate a PDF. I will have a lot of tables in my PDF. Maybe it is better to create a special CSS class that performs this styling, but how do I assign a CSS class to one row in a dataframe only?</p>