Handsontable example

by aszymanski

HTML

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

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

CSS

.handsontable .newColor {
   color: blue;
}

JavaScript

const container = document.querySelector('#example1');

const hot = new Handsontable(container, {
  data: Handsontable.helper.createSpreadsheetData(5, 5),
  colHeaders: true,
  rowHeaders: true,
  height: 'auto',
  licenseKey: 'non-commercial-and-evaluation',
  cells: function(row, col, prop) {
    let cellProperties = {};

    if (row === 3 && col === 2) {
      cellProperties.className = 'newColor'
    }

    return cellProperties;
  },
});