Handsontable example

by handsoncode

HTML

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

JavaScript

const example = document.getElementById('example');
  const hot = new Handsontable(example, {
    data: Handsontable.helper.createSpreadsheetData(10, 10),
    licenseKey: 'non-commercial-and-evaluation',
    colWidths: 100,
    rowHeaders: true,
    colHeaders: true,
    dropdownMenu: true,
    filters: true,
    manualColumnMove: true,
    afterGetColHeader(col, TH) {
       if (col < 2){
        const button = TH.querySelector('.changeType');
        
        if (!button) {
        	return;
        }
        
        button.parentElement.removeChild(button);
      }
    },
  });