Handsontable example

by aszymanski

HTML

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

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

JavaScript

var container = document.getElementById('example1'),
  hot = new Handsontable(container, {
    data: Handsontable.helper.createSpreadsheetData(10, 10),
    rowHeaders: true,
    colHeaders: true,
    contextMenu: true,
    height: 'auto',
    comments: true,
    renderAllRows: true,
  });


  hot.updateSettings({
    afterSelection(row, column, row2, column2, preventScrolling, selectionLayerLevel) {
      console.log(row, column)
    }
  })