将数据表的所有行(最后一行除外)的光标更改为指针

change cursor to pointer for all rows of the datatable except the last one

本文关键字:指针 光标 数据表 最后 一行      更新时间:2023-09-26

这是我到目前为止所做的

var table = new google.visualization.Table(document.getElementById('report_results'));
var view = new google.visualization.DataView(d);
var swidth = screen.width;
view.setColumns([2,3,4,5,6,7,8,9,10]);
var cssClassNames = {'hoverTableRow': 'hover-table-row'};
var swidth = screen.width;
table.draw(view, {height: 700,width:swidth,'cssClassNames':cssClassNames});
<style>
.hover-table-row{
        color: #9a64ff;
        cursor:pointer;
}
</style>

现在,我将光标作为指针,除最后一行外,所有行中。我怎样才能做到这一点?

您需要

使用 CSS 为最后一个单元格定义一个default光标值:

.hover-table-tow:last-child {
  cursor:default;
}

你可以纯粹用CSS来完成这个。

在 .hover-table-row css 之后添加这个

.hover-table-tow:last-child {
  cursor: default;
  color: #000000;
}

更多信息:

https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child

https://developer.mozilla.org/en-US/docs/Web/CSS/cursor