I inserted info about what to change in the first script here (gray text is information about what to change)
For Table block
1. If you want information to displaying when hovering:
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script>
window.addEventListener('load', function() {
setTimeout(function() {
var table1 = document.querySelector("#table1"); /* change #table1 by the name of your block with #just before it */
var headerCells = table1.querySelectorAll(".ag-header-cell");
headerCells.forEach(function(cell, index) {
var nthChild = index + 1;
var tooltipContent = getTooltipContent(nthChild);
tippy(cell, { content: tooltipContent, placement: 'bottom' }); /*You can change the placement by changing 'bottom' by 'top' for example */
});
}, 1200);
function getTooltipContent(nthChild) {
switch (nthChild) {
case 1:
return 'Tooltip for first element'; /* Add as many use cases as headers/labels you have + change 'Tooltip for first/second/third/etc element' by the exact text you want to display*/
case 2:
return 'Tooltip for second element';
case 3:
return 'Tooltip for third element';
case 4:
return 'Tooltip for fourth element';
}
}
});
</script>
2. If you want the information to be displayed when clicking
<script>
window.addEventListener('load', function() {
setTimeout(function() {
var table2 = document.querySelector("#table2");
var headerCells = table2.querySelectorAll(".ag-header-cell");
headerCells.forEach(function(cell, index) {
var nthChild = index + 1;
var tooltipContent = getTooltipContent(nthChild);
cell.addEventListener('click', function() {
tippy(cell, { content: tooltipContent, placement: 'bottom' }).show();
});
});
}, 1200);
function getTooltipContent(nthChild) {
switch (nthChild) {
case 1:
return 'Tooltip for first element';
case 2:
return 'Tooltip for second element';
case 3:
return 'Tooltip for third element';
case 4:
return 'Tooltip for fourth element';
}
}
});
</script>
For list details block
1. if you want the information to be displayed when hovering
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script>
window.addEventListener('load', function() {
setTimeout(function() {
var listdetails1 = document.querySelector("#list-details1");
var headerCells1 = listdetails1.querySelectorAll(".label-wrapper.vertical .css-0");
headerCells1.forEach(function(cell, index) {
var nthChild = index + 1;
var tooltipContent = getTooltipContent(nthChild);
tippy(cell, { content: tooltipContent, placement: 'bottom' });
});
function getTooltipContent(nthChild) {
switch (nthChild) {
case 1:
return 'Tooltip for first element';
case 2:
return 'Tooltip for second element';
case 3:
return 'Tooltip for third element';
case 4:
return 'Tooltip for fourth element';
}
}
}, 1200);
});
</script>
2. If you want the information to be displayed when clicking
<script src="https://unpkg.com/@popperjs/core@2"></script>
<script src="https://unpkg.com/tippy.js@6"></script>
<script>
window.addEventListener('load', function() {
setTimeout(function() {
var listdetails1 = document.querySelector("#list-details1");
var headerCells1 = listdetails1.querySelectorAll(".label-wrapper.vertical .css-0");
headerCells1.forEach(function(cell, index) {
var nthChild = index + 1;
var tooltipContent = getTooltipContent(nthChild);
cell.addEventListener('click', function() {
tippy(cell, { content: tooltipContent, placement: 'bottom' }).show();
});
});
function getTooltipContent(nthChild) {
switch (nthChild) {
case 1:
return 'Tooltip for first element';
case 2:
return 'Tooltip for second element';
case 3:
return 'Tooltip for third element';
case 4:
return 'Tooltip for fourth element';
}
}
}, 1200);
});
</script>