Python Conditionally Add Class to <td> Tags in HTML Table
问题 I have some data in the form of a csv file that I'm reading into Python and converting to an HTML table using Pandas. Heres some example data: name threshold col1 col2 col3 A 10 12 9 13 B 15 18 17 23 C 20 19 22 25 And some code: import pandas as pd df = pd.read_csv("data.csv") table = df.to_html(index=False) This creates the following HTML: <table border="1" class="dataframe"> <thead> <tr style="text-align: right;"> <th>name</th> <th>threshold</th> <th>col1</th> <th>col2</th> <th>col3</th> <