Is there a way of changing the colours of rows based on the data in the row. For example, I am generating a HTML with a name column.
I want anything with the name Smith to be one colour and anything with the name Jones to be another colour as follows.
I've copied the below off the internet to generate my table but I don't know if I can change this so it does the above.
<style>
table {
border: 1px solid black;
width: 100%;
text-align: left;
border-collapse: collapse;
}
table th {
border: 1px solid black;
background-color: #c91414;
color:white;
border-collapse: collapse;
padding: 5px;
}
table td {
border: 1px solid black;
background-color: #EEEEEE;
border-collapse: collapse;
padding: 5px;
}
</style>
thanks

Report
All responses (
Answers (