[]
        
(Showing Draft Content)

Scrollbar Options

You can control the visibility and scrolling behavior of workbook scrollbars.

Show or Hide Scrollbars

Use showHorizontalScrollbar and showVerticalScrollbar to control scrollbar visibility.

These properties support three values:

  • true — Always show the scrollbar

  • false — Always hide the scrollbar

  • "auto" — Show the scrollbar only when the worksheet has scrollable content

When set to "auto", the scrollbar is automatically hidden if the content fully fits within the viewport.

spread.options.showHorizontalScrollbar = "auto";
spread.options.showVerticalScrollbar = "auto";

autoShow.gif

In "auto" mode, the scrollbar is also hidden if:

  • All rows and columns fit within the viewport

  • Frozen rows or columns eliminate all scrollable area

Note: When exporting to Excel, "auto" is treated as true because Excel does not support automatic scrollbar visibility.

Control the Scrollable Range

You can adjust how the scrollbar determines its scrollable range.

  • scrollbarMaxAlign: Aligns the scrollbar with the last row and column of the active sheet.

  • scrollbarShowMax: Calculates the scrollbar range based on the total row and column count.

spread.options.scrollbarMaxAlign = true;

scrollbarMaxAlign.gif

spread.options.scrollbarShowMax = true;

scrollbarShowMax.gif

Ignore Hidden Rows and Columns

Use scrollIgnoreHidden to exclude hidden rows and columns from scrollbar calculations.

Hidden rows and columns include:

  • Zero height or width

  • Rows or columns hidden using the visible method

  • Collapsed grouped rows or columns

  • Filtered-out rows

spread.options.scrollIgnoreHidden = true;