Handsontable example
HTML
<script src="https://cdn.jsdelivr.net/npm/handsontable@16.1/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@16.1/styles/handsontable.min.css" />
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@16.1/styles/ht-theme-main.css" />
<script src="https://handsontable.com/docs/scripts/fixer.js"></script>
<div id="example1" class="hot"></div>
TypeScript
import Handsontable from 'handsontable/base';
import { registerAllModules } from 'handsontable/registry';
import 'handsontable/styles/handsontable.css';
import 'handsontable/styles/ht-theme-main.css';
// Register all Handsontable's modules.
registerAllModules();
// generate an array of arrays with dummy data
const data: string[][] = new Array(100) // number of rows
.fill(null)
.map((_, row) =>
new Array(50) // number of columns
.fill(null)
.map((_, column) => `${row}, ${column}`)
);
const container = document.querySelector('#example1')!;
new Handsontable(container, {
themeName: 'ht-theme-main',
data,
height: 320,
autoColumnSize: {
allowSampleDuplicates: true,
samplingRatio: 100,
},
rowHeaders: true,
colHeaders: true,
contextMenu: true,
mimeFastEdit: true,
autoWrapRow: true,
autoWrapCol: true,
licenseKey: 'non-commercial-and-evaluation',
});