Changing the background color of a row in a table on hover is pretty simple with CSS:
.HighlightableRow:hover
{
background-color: lightgray;
}
And some HTML:
<table>
<tr class=HighlightableRow>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<tr>
<tr class=HighlightableRow>
<td>Cell 1</td>
<td>Cell 2</td>
<td>Cell 3</td>
<tr>
</table>
Sometimes I want to highlight a couple of lines when I hover over any of them. For example, when displaying a list of work orders in the table, I will have one line with the creator, date of creation, urgency, etc., And the second line will be with the exception of the requested work.
Is there any way other than using the onmouseover / onmouseout JavaScript event handlers to create an effect like the one shown above? CSS is preferred.
source
share