【发布时间】:2021-03-27 15:24:10
【问题描述】:
我想将鼠标悬停在一行上并将悬停样式应用于其他表的同一“n”行。我可以用纯 CSS 做到这一点,而不使用 javascript 或 jquery 吗?所有表的行数都相同
我附上一张画图,以便您更好地理解问题。
如果不能,替代解决方案是使用 ngclass 和 javascript
<table class="maintable">
<tr>
<td>
<table class="childtable1">
<tr>
<td> Row 1 of childtable1</td>
</tr>
<tr>
<td> Row 2 of childtable1</td>
</tr>
<tr>
<td> Row 3 of childtable1</td>
</tr>
</table>
</td>
<td>
<table class="childtable2">
<tr>
<td> Row 1 of childtable2</td>
</tr>
<tr>
<td> Row 2 of childtable2</td>
</tr>
<tr>
<td> Row 3 of childtable2</td>
</tr>
</table>
</td>
<td>
<table class="childtable3">
<tr>
<td> Row 1 of childtable3</td>
</tr>
<tr>
<td> Row 2 of childtable3</td>
</tr>
<tr>
<td> Row 3 of childtable3</td>
</tr>
</table>
</td>
</tr>
【问题讨论】:
-
你能分享你的HTML吗?
-
我更新了一个简单的代码示例。
标签: css css-tables