I’ve created tooltips to popup when I hover over column headers. I would like them to align just above the header. I have accomplished this as follows
afterOnCellMouseOver: function(e, coords, TD) {
if (coords.row < 0) {
var columnIndex = coords.col;
if (columnTooltips.hasOwnProperty(columnIndex)) {
tooltip.style.visibility = ‘visible’;
tooltip.innerHTML = columnTooltips[columnIndex];
tooltip.style.position = ‘absolute’;
// Adjust the vertical position to appear just below the header cell
tooltip.style.top = `${TD.getBoundingClientRect().bottom - 200}px`;
tooltip.style.padding = '5px';
tooltip.style.left = `${TD.getBoundingClientRect().left - 100}px`;
}
}
},
This works for a full screen, but at any other size the tooltips shift position, sometimes out of sight.