I am converting a JSON file into HTML (which I am able to achieve) using "json2html" library . Apart from that, I am trying to add colorin one of the column depending upon the result. If it says true - I want the Background to be GREEN color , IF False, then RED color
import json2html
table = json2html.convert(json = data_to_be_sent)
report_html = table
Below is how my Output/HTML/report_html file looks like right now: All I want to do is add color to 'Success' column depending upon the result
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700,900" />
</head>
<body style="color: #333; font-family: Source Sans Pro;";>
<h2>Nightly Validation Report (2019/09/19, prod)</h2>
<h3>Nightly Validation Report (XX)</h3>
<br><br><table border="1"><tr><th>CorrelationId</th>
<td>awsnightlyendtoend_XX_20190919T2319</td></tr><tr>
<th>ValidationType</th><td>validate_adwactivityfact</td></tr><tr>
<th>Success</th><td>False</td></tr><tr><th>OutputPath</th><td><ul><li><a
href=https://XXXXX</a></li><li><a
href=https://XXXXX</a></li></ul></td></tr><tr><th>ValidationDetail</th>
<td>Comparison Failed: matched=211009, missing=5, mismatched=0, percent success=99.9952609779446%</td></tr></table>
</html>