作为一项要求,我想在 handsontable 中突出显示所选单元格的行和列标题,基本上我想在单击单元格时更改相应标题的背景颜色。
Handsontable 具有内置属性,可在单击单元格时突出显示整行
var
data = [
['', 'Kia', 'Nissan', 'Toyota', 'Honda'],
['2013', 10, 11, 12, 13],
['2014', 20, 11, 14, 13],
['2015', 30, 15, 12, 13]
],
container = document.getElementById('example1'),
hot;
hot = Handsontable(container, {
data: data,
minRows: 5,
minCols: 6,
currentRowClassName: 'currentRow',
currentColClassName: 'currentCol',
rowHeaders: true,
colHeaders: true
});
hot.selectCell(2,2);
但我只想通过更改其背景颜色来突出显示标题,有什么方法可以使用自定义渲染器来实现吗?
最佳答案
除了代码,还有一些 CSS。
.handsontable td.currentRow, .handsontable td.current {
background: #f8f9f9;
}
归功于此 solution .
关于javascript - 如何突出显示 handsontable 的选定行和标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36996980/