I get get the background color to work on a <td>
but not a <tr>
.
I am using Firefox, version: 128.0+linuxmint1+virginia on Linux Mint (Mate)
body {
margins: 2mm;
}
h3 {
font-family: Arial, sans-serif
}
p {
page-break-inside: avoid;
font-family: Arial, sans-serif;
font-size: medium;
font-weight: normal;
color: black;
margin-bottom: 0.0in
}
table {
border-width: 3px;
border-spacing: 2px;
border-style: solid;
border-color: black;
border-collapse: collapse;
}
table tr {
border-width: 1px;
padding: 5px;
border-style: solid;
border-color: black;
}
table tr.yellow {
background-color: yellow;
}
table th {
border-width: 3px;
padding: 5px;
border-style: solid;
border-color: black;
}
table td {
border-width: 1px;
padding: 5px;
border-style: solid;
border-color: black;
}
table td.aqua {
background-color: aqua;
}
<P> $Revision$</p>
<br>
<table class="sample" width="98%" cellpadding="0" cellspacing="0" border="1">
<col width="18%">
<col width="12%">
<col width="12%">
<col width="12%">
<col width="12%">
<col width="12%">
<col width="12%">
<thead>
<tr>
<th>Day</th>
<th>AM</th>
<th>PM</th>
<th>AM</th>
<th>PM</th>
<th>AM</th>
<th>PM</th>
</tr>
</thead>
<tr>
<td>Sunday</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Monday</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Tuesday</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr class="yellow">
<td>Wednesday</td>
<td> </td>
<td class="aqua"> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Thursday</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Friday</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Saturday</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
Resulting Firefox display:
The 'aqua' colored <td> works.
The 'yellow' colored <tr> does not work!! ( remains black characters on white background.
I am not interested in striping.
I realize that I could set each <td>
in the row, but I would like to know why the <tr>
property does not work.
I did read the similar question where an extra space ruined the grammar.
Running tidy returned “No warnings or errors were found.
New contributor
user26412536 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
2