Seeking guidance on HTML and CSS with a simple query.
How can I assign different colors to each row in a table? For instance, row 1 as red, row 2 as blue, and so on.
Here is my HTML code:
#table {
font-family: Arial, Helvetica, sans-serif;
width: 600px;
border-collapse;
collapse;
}
#table td,
#table th {
font-size: 12x;
border: 1px solid #4D365B;
padding: 3px 7px 2px 7px;
}
#table th {
font-size: 14px;
text-align: left;
padding-top: px;
padding-bottom: 4px;
background-color: #4D365B;
color: #918CB5;
}
#table td {
color: #000000;
background-color: #979BCA;
}
<table id="table">
<tr>
<th>Company</th>
<th>Contact
<th>Country</th>
</tr>
<tr>
<td>1</td>
<td>2
<td>3</td>
</tr>
<tr>
<td>1</td>
<td>2
<td>3</td>
</tr>
<tr>
<td>1</td>
<td>2
<td>3</td>
</tr>
</table>