class HtmlService method .setWidth()

HtmlService is the Apps Script service.

.setWidth() is the method name you will see after a dot in your code.

What it does

Sets the width of a dialog in pixels.

Why it's used

  • Widen a picker dialog so columns fit.
  • Size modals for forms with several fields.

Common errors

  • Forgetting parentheses on setWidth. Write HtmlService.setWidth(), not HtmlService.setWidth or setWidth by itself.
  • Skipping dots between chained calls. Each step needs a dot, like HtmlService.setWidth().
  • Adding spaces where they do not belong. Write HtmlService.setWidth(), not HtmlService .setWidth(), HtmlService.setWidth (), or HtmlService . setWidth().
  • Wrong capitalization. Use HtmlService and setWidth, not htmlservice or setwidth.

Explore

Related methods

Better Sheets tutorials

Big Year - a Whole Year in One Google Sheets Tab

Big Year - a Whole Year in One Google Sheets Tab

Get "Big Year" for free via Gumroad. Get perspective on your 2024 plan ...

Related blog posts

Written guides about HtmlService.setWidth().

Browse the blog