JSFiddle - React, Tailwind, and code Playground

by futurecrew

HTML

<div id="example1" class="hot handsontable htRowHeaders htColumnHeaders" style="height: 320px; overflow: hidden; width: 100%;" data-originalstyle="height: 320px; overflow: hidden; width: 100%;"></div>

CSS

</style><!-- Ugly Hack due to jsFiddle issue -->

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

JavaScript

var container = document.getElementById('example1');
  var hot = new Handsontable(container, {
      contextMenu: true,
      data: Handsontable.helper.createSpreadsheetData(10, 3),
      columns: function(index) {
        if (index == 0) {
            return {    
              type: 'numeric',
              numericFormat: {
                pattern: '0,0'
              }
            };
        } else if (index == 1) {
            return {
              type: 'dropdown',
              source: ['A', 'B', 'C', 'D']
            };
        } 
        return {};
      }
  });