当鼠标悬停在 material-table 中的一行时,在一行中突出显示

Highlight in a row when the mouse is over a row in material-table

我必须使用哪个组件,才能在鼠标悬停在一行上时使用 material-table 组件获得连续的高亮显示?

我找不到任何 属性 或哪个组件覆盖来获得它。

提前感谢您的宝贵时间 最好的问候

这是代码https://codesandbox.io/s/yv13zjr9w9

您可以创建一个 css 来突出显示行

tr:hover{
background:gray;
}

参考沙箱

https://codesandbox.io/s/y686o6n9

如果您只希望这个 table 具有悬停效果,请将其包裹在另一个元素中或给它一个 class,如上例所示:

https://codesandbox.io/s/4wkpp98z69

.myTable tr:hover {
  background-color: red;
}