I'm trying to change the background-color of a parent <td>
element, however I cannot edit the HTML directly. The program my workplace uses is very rigid and only accepts SQL queries. The program then builds an HTML table from the query and automatically sends the result set out as an email. I cannot edit the HTML before it sends.
To get around this, I've figured out a way to change some properties of the table by injecting my own child elements through the query. For example:
Original query: SELECT column1 FROM table;
HTML cell output:
<td>
<p>
<span> value </span>
</p>
</td>
Modified query:
SELECT '<span style="color:red">' + column1 + '</span>' AS [column1] FROM table;
HTML cell output:
<td>
<p>
<span>
<span style="color:red"> value </span>
</span>
</p>
</td>
Through this method I'm able change the style of the text. However, I cannot figure out how to change the background-color property of the parent <td>
element. Is there any way I can change the style of the <td>
element using this method? Am I out of luck?
.....
value
value