I have a layout with two adjacent tables. When a row in one table is hovered, I'd like to apply the same style to the cells in the rows across both tables.
Is this possible with css only?
table{
display: inline-block;
}
td{
border:1px solid grey;
}
table#lhs tr:hover{
background-color:green;
}
table#lhs tr:hover {
background-color:green;
}
<table id="lhs">
<tr>
<td>lhs row 1</td>
</tr>
<tr>
<td>lhs row 2</td>
</tr>
<tr>
<td>lhs row 3</td>
</tr>
</table>
<table id="rhs">
<tr>
<td>rhs row 1</td>
</tr>
<tr>
<td>rhs row 2</td>
</tr>
<tr>
<td>rhs row 3</td>
</tr>
</table>