Handsontable example

by handsoncode

HTML

<script src="https://cdn.jsdelivr.net/npm/handsontable@12.1/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@12.1/dist/handsontable.full.min.css">

<div>
  <div id="example1" class="hot handsontable htRowHeaders htColumnHeaders"></div>
</div>

JavaScript

var example1 = document.getElementById('example1');
  
  var hot = new Handsontable(example1, {
    data: Handsontable.helper.createSpreadsheetData(5,10),
    colHeaders: true,
    rowHeaders: true,
    afterGetColHeader: function(col, TH){
    	if(col === -1){
      	TH.innerHTML = '<input type="checkbox"></input>' 
      }
    },
  });