Handsontable example

by Luiz Vargas

HTML

<div id="example1"></div>

CSS

.handsontable thead th .relative {
  padding: 0 !important;
}

.myCol {
  font-size: 33px;
  background: red;
  padding: 6px
}

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

JavaScript

var
  example = document.getElementById('example1'),
  hot = new Handsontable(example, {
    data: Handsontable.helper.createSpreadsheetData(10, 10),
    colHeaders: function(col) {
      if (col === 6) {
        return '<div class="myCol">Metric 1</div>'
      } else {
        return col
      }
    }
  });