Freeze columns

The spreadsheet freeze columns property helps to sticky some columns floating left on the spreadsheet. The property can be defined programmatically as below:

Documentation

Methods

Define or reset the number of freeze columns programmatically.
MethodDescription
setFreezeColumns(number) Set the freeze columns.
setFreezeColumns(number: number) : void
resetFreezeColumns() Reset the freeze columns.
resetFreezeColumns() : void


Initial Settings

The following property is available through the initialization of the online spreadsheet.
PropertyDescription
freezeColumns: numberDefine the number of freeze columns on initialization.
freezeColumnControl: boolean PremiumEnable freeze column manual control. Default: false


Examples

Basic freeze column usage.

It is possible to define the viewport when using the freeze columns, as follow:




Source code

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

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

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

<script>
// Set your JSS license key (The following key only works for one day)
jspreadsheet.setLicense('MTYwMjY0NjFmZGJhNzdlYmNiMzEzOWI3Mjk2MjdiZGRlNzIwMmFiOWQzMzQ4ZDJjYjJhM2M0ZTBmMTdjOTRkNDJkYzZjYmUzMzZiMGVhMDI1MGQ1MzIxNDBlZjliMDhmOTc2YmIyZGFkNTZhODMxNWM5MjcyMzE5MDI1YmZiYzUsZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UWTJNREk0TVRVNE9Td2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWJHOWpZV3hvYjNOMElsMHNJbkJzWVc0aU9pSXpJaXdpYzJOdmNHVWlPbHNpZGpjaUxDSjJPQ0lzSW5ZNUlpd2lZMmhoY25Seklpd2labTl5YlhNaUxDSm1iM0p0ZFd4aElpd2ljR0Z5YzJWeUlpd2ljbVZ1WkdWeUlpd2lZMjl0YldWdWRITWlMQ0pwYlhCdmNuUWlMQ0ppWVhJaUxDSjJZV3hwWkdGMGFXOXVjeUlzSW5ObFlYSmphQ0pkTENKa1pXMXZJanAwY25WbGZRPT0=');

// Create a new spreadsheet
jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [{
        minDimensions: [50,20],
        tableOverflow: true,
        tableWidth: '800px',
        freezeColumns: 2
    }]
});
</script>
</html>


Enable manual freeze controls Premium

Enable the interface controls for manual adjustments.




Source code

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

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />

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

<script>
jspreadsheet(document.getElementById('spreadsheet'), {
    worksheets: [{
        minDimensions: [50,20],
        tableOverflow: true,
        tableWidth: '800px',
        freezeRowControl: true,
        freezeColumnControl: true,
    }]
});
</script>
</html>