Handsontable example

HTML

<div id="example1"></div>
<button id="hideColumn">
  Hide column Age
</button>

CSS

</style> /* pre 8.0.0 build 13/07 */
<script src="https://cdn.jsdelivr.net/gh/handsontable/handsontable@7e15af798aad2cc583c2eec148690515b3281c3c/dist/handsontable.full.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/gh/handsontable/handsontable@7e15af798aad2cc583c2eec148690515b3281c3c/dist/handsontable.full.css">

JavaScript

var myHeaders = ['Id', 'Name', 'Age'];
  var example = document.getElementById('example1');
  var hot = new Handsontable(example, {
    data: [{
      id: 1,
      profile: {
        name: 'Jerry'
      },
      age: 50
    }, {
      id: 2,
      profile: null,
      age: 60
    },{
      id: 3,
      profile: {
        name: 'Jerry 3'
      },
      age: 70
    }],
    colWidths: 150,
    colHeaders: myHeaders,
    columns: [
      {
        data: function(dataObject) {
          return dataObject.id;
        }
      },
      {
        data: 'name'
      },
      {
        data: 'age'
      }
    ]
  });
  
  const button = document.getElementById('hideColumn');
  button.addEventListener('click', () => {
		hot.selectRows(0, 1);
    hot.render();
  });