I am facing an issue with highlighting rows in a table that contains rowspan elements. Here is the HTML code:
<table width="800" cellpadding="5" border="1">
<tr class="head">
<th>NO.</th>
<th>FOOD NAME</th>
<th>TYPE</th>
<th>STATUS</th>
</tr>
<tr class='row'>
<td rowspan='2' align='center'>1.</td>
<td rowspan='2'>Mozarella Cheese</td>
<td>Regular</td>
<td rowspan='2' align='center'>Available</td>
</tr>
<tr class='row'>
<td>Premium</td>
</tr>
<tr class='row'>
<td rowspan='2' align='center'>2.</td>
<td rowspan='2'>Greentea Milk</td>
<td>Regular</td>
<td rowspan='2' align='center'>Available</td>
</tr>
<tr class='row'>
<td>Premium</td>
</tr>
</table>
Additionally, here is my CSS code for styling the table:
.head {
background: rgb(206,220,231);
/* Other background properties */
}
.head th {
padding:10px;
color:#333;
text-shadow:1px 1px 0px #CCC;
font-size:14px;
}
.row {
background-color:#E0E0E0;
font-size:12px;
}
.row:hover td[rowspan] {
background: #00FF33;
font-weight:bold;
cursor:pointer;
}
.row:hover td[rowspan]:hover ~ tr {
background: #00FF33;
font-weight:bold;
cursor:pointer;
}
I need help in resolving the issue of highlighting rows in a table with rowspan elements. The current CSS code doesn't seem to work well due to the presence of rowspan. Any suggestions on how to achieve highlighted rows in this scenario?