JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://cdn.jsdelivr.net/npm/handsontable@latest/dist/handsontable.full.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@latest/dist/handsontable.full.css">
<div class="result"></div>
<div class="ht"></div>
JavaScript
const rel = document.querySelector('.result');
const ht = document.querySelector('.ht');
const API = 'https://randomuser.me/api/?results=10';
let hot, data;
data = [
{
"First name": "Emma",
"Last name": "Garcia",
"E-mail": "emma.garcia@example.com",
"Country": "United States"
},
{
"First name": "Noah",
"Last name": "Hernandez",
"E-mail": "noah.hernandez@example.com",
"Country": "Canada"
},
{
"First name": "Olivia",
"Last name": "Gomez",
"E-mail": "olivia.gomez@example.com",
"Country": "Mexico"
},
{
"First name": "Liam",
"Last name": "Davis",
"E-mail": "liam.davis@example.com",
"Country": "Australia"
},
{
"First name": "Ava",
"Last name": "Taylor",
"E-mail": "ava.taylor@example.com",
"Country": "United Kingdom"
},
{
"First name": "William",
"Last name": "Brown",
"E-mail": "william.brown@example.com",
"Country": "Germany"
},
{
"First name": "Sophia",
"Last name": "Miller",
"E-mail": "sophia.miller@example.com",
"Country": "Japan"
},
{
"First name": "Mason",
"Last name": "Wilson",
"E-mail": "mason.wilson@example.com",
"Country": "France"
},
{
"First name": "Isabella",
"Last name": "Moore",
"E-mail": "isabella.moore@example.com",
"Country": "Spain"
},
{
"First name": "James",
"Last name": "Jackson",
"E-mail": "james.jackson@example.com",
"Country": "Brazil"
},
{
"First name": "Mia",
"Last name": "Lee",
"E-mail": "mia.lee@example.com",
"Country": "Russia"
},
{
"First name": "Benjamin",
"Last name": "Perez",
"E-mail": "benjamin.perez@example.com",
"Country": "India"
},
{
"First name": "Charlotte",
"Last name": "Hall",
"E-mail": "charlotte.hall@example.com",
"Country": "China"
}
]
hot = new Handsontable(ht, {
data,
colHeaders: ['First name', 'Last name', 'E-mail', 'Country'],
rowHeaders: true,
colWidths:...