You can also pre-define comments for your table. Comments are stored in the table's/column's/cell's metadata object and can be declared as any value of that type. For example:
By default, all comments are editable. To change this, set the readOnly parameter to true when adding a comment. This example makes the "Tesla" comment attached to a cell read-only, whereas the "Honda" comment attached to another cell is editable.
const container = document.querySelector('#example2');const hot =newHandsontable(container,{data:[['','Tesla','Toyota','Honda','Ford'],['2018',10,11,12,13,15,16],['2019',10,11,12,13,15,16],['2020',10,11,12,13,15,16],],rowHeaders:true,colHeaders:true,contextMenu:true,comments:true,cell:[{row:0,col:1,comment:{value:'A read-only comment.',readOnly:true}},{row:0,col:3,comment:{value:'You can edit this comment'}}],height:'auto',licenseKey:'non-commercial-and-evaluation'});
To display comments after a pre-configured time delay, use the displayDelay parameter.
const container = document.querySelector('#example4');const hot =newHandsontable(container,{data:[['','Tesla','Toyota','Honda','Ford'],['2018',10,11,12,13,15,16],['2019',10,11,12,13,15,16],['2020',10,11,12,13,15,16],],rowHeaders:true,colHeaders:true,contextMenu:true,comments:{// on mouseover, wait 2 seconds before the comment box displaysdisplayDelay:2000,},cell:[{row:1,col:1,comment:{value:'Some comment'}},],height:'auto',licenseKey:'non-commercial-and-evaluation'});