Autonumber

The native auto increment column type can be used as shown below.



Source code

<html>
<script src="https://jspreadsheet.com/v8/jspreadsheet.js"></script>
<script src="https://jsuites.net/v4/jsuites.js"></script>
<link rel="stylesheet" href="https://jspreadsheet.com/v8/jspreadsheet.css" type="text/css" />
<link rel="stylesheet" href="https://jsuites.net/v4/jsuites.css" type="text/css" />

<div id="spreadsheet"></div>

<script>
// Set the JSS spreadsheet license
jspreadsheet.setLicense('OTBmYjY5OTdkZTg4ODZlOGIxNzYzZDFkMmE4NDhhOWIwYTYzOTI5NGQxMDZjMWIzZmZjYmQ3MzU5NzQ3NGU2MTRjMDM1YTYxYjM0ZjIxMzg2ODY3NjBkNGVlNmM5NmFmOGZkOThmZDc3YzQyOTc0YzYwYmYwZTA1MzRjODM3YWIsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTJORFF5TURJMU55d2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0=');

// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [{
        data: [
            ["1","DIVINELY UNINSPIRED TO A HELLISH EXTENT","LEWIS CAPALDI"],
            ["2","NO 6 COLLABORATIONS PROJECT","ED SHEERAN"],
            ["3","THE GREATEST SHOWMAN","MOTION PICTURE CAST RECORDING"],
            ["4","WHEN WE ALL FALL ASLEEP WHERE DO WE GO","BILLIE EILISH"],
            ["5","STAYING AT TAMARA'S","GEORGE EZRA"],
            ["6","BOHEMIAN RHAPSODY - OST","QUEEN"],
            ["7","THANK U NEXT","ARIANA GRANDE"],
            ["8","WHAT A TIME TO BE ALIVE","TOM WALKER"],
            ["9","A STAR IS BORN","MOTION PICTURE CAST RECORDING"],
            ["10","YOU'RE IN MY HEART","ROD STEWART"]
        ],
        columns: [
            { type: 'autonumber', title: 'Id', readOnly: true, primaryKey: true, },
            { type: 'text', width: '350px', title: 'Title' },
            { type: 'text', width: '250px', title: 'Artist' }
        ],
    }]
});
</script>
</html>