JSFiddle - React, Tailwind, and code Playground

by namihihii

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>

JavaScript

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

const hot = new Handsontable(container, {
  data: [
    ['ホンダ', 2017, 'black', 'black'],
    ['日産', 2018, 'blue', 'blue'],
    ['トヨタ', 2019, 'yellow', 'black']
  ],
  colHeaders: ['Car', 'Year', 'Color'],
  columns: [
    {},
    { type: 'numeric' },
    {
      type: 'dropdown',
      source: ['yellow', 'red', 'orange', 'green', 'blue', 'gray', 'black', 'white']
    }
  ],
  licenseKey: 'non-commercial-and-evaluation'
});

function addColorOption() {
 alert('Purple added!')
}