When working on my HTML page, I have utilized multiple <tr>
tags with different bgcolor
values such as:
<tr bgcolor="#000000">
<tr bgcolor="#E5F1CC">
<tr bgcolor="#D30A0A">
<tr bgcolor="#656766">
I am aiming to assign unique background colors for each individual <tr>
tag.
Notably, there are no classes or ids included in the HTML structure.
My objective is to set background colors for all <tr>
elements using CSS without modifying the existing HTML code, based on their respective count within the document.
In other words, I aim to dynamically determine the number of <tr>
elements present in the HTML and assign distinct bgcolors
to each one.
Do you think this can be achieved?