Handsontable example

HTML

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

CSS

</style>< !-- Ugly Hack due to jsFiddle issue --><script src="https://docs.handsontable.com/pro/5.0.0/components/handsontable-pro/dist/handsontable.full.min.js"></script><link type="text/css" rel="stylesheet" href="https://docs.handsontable.com/pro/5.0.0/components/handsontable-pro/dist/handsontable.full.min.css"><script src="https://docs.handsontable.com/pro/5.0.0/components/numbro/dist/languages.min.js"></script>

JavaScript

var
  container = document.getElementById('example1'),
  hot;
var reg = /^\d+$/;
hot = new Handsontable(container, {
  data: [
    [1]
  ],
  colHeaders: true,
  beforeKeyDown: function(e) {
    if (!reg.test(e.key)) {
      e.preventDefault()
    }
  }
});