Skip to main content Skip to footer

Remove the additional gray/white space in pure JavaScript

Background:

To remove the additional space in a SpreadJS instance set the scrollBarMaxAlign option to True. This will remove the space and only allow users to scroll to ends of the sheet or the last column/row.

Steps to Complete:

Set scrollBarMaxAlign to True

Getting Started:

Set scrollBarMaxAlign to True

Set the scrollBarMaxAlign option to True to specify that we want to set the scroll bar to be aligned with the last row and column of the active sheet.

var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));

document.getElementById("btn").addEventListener("click", function() {
  var spreadContainer = document.getElementById("ss");
  // set scrollbar max align to True
  spread.options.scrollbarMaxAlign = true;
 });

For an additional reference, here is a link to a live code sample showing this: https://codesandbox.io/s/spread-js-starter-5cd0p?file=/src/index.js:331-348

Mackenzie Albitz