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/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/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('MzBiNTJlOWI5M2RiZDgwODg2Y2U1NGQzMjQwYzA1NWU4ZThkMGM2YWNkMzYwNDFjZjQ4M2M1OGNjY2E4YjE3ODNkMTRjNmEzZjhmODdiNGE4NjZlMWJjMWQ1OTczMmJjMWM4Zjg1NjQxYzQ3NWQwYTMwOWE1ZDhiYjQ4YzA0MjksZXlKdVlXMWxJam9pU25Od2NtVmhaSE5vWldWMElpd2laR0YwWlNJNk1UY3hNRGt3T1RJM01Td2laRzl0WVdsdUlqcGJJbXB6Y0hKbFlXUnphR1ZsZEM1amIyMGlMQ0pqYjJSbGMyRnVaR0p2ZUM1cGJ5SXNJbXB6YUdWc2JDNXVaWFFpTENKamMySXVZWEJ3SWl3aWQyVmlJaXdpYkc5allXeG9iM04wSWwwc0luQnNZVzRpT2lJek5DSXNJbk5qYjNCbElqcGJJblkzSWl3aWRqZ2lMQ0oyT1NJc0luWXhNQ0lzSW1Ob1lYSjBjeUlzSW1admNtMXpJaXdpWm05eWJYVnNZU0lzSW5CaGNuTmxjaUlzSW5KbGJtUmxjaUlzSW1OdmJXMWxiblJ6SWl3aWFXMXdiM0owWlhJaUxDSmlZWElpTENKMllXeHBaR0YwYVc5dWN5SXNJbk5sWVhKamFDSXNJbkJ5YVc1MElpd2ljMmhsWlhSeklsMHNJbVJsYlc4aU9uUnlkV1Y5');

// 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/v5/jsuites.js"></script>
<link rel="stylesheet" href="https://jsuites.net/v5/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>