Sets the width of a dialog in pixels.
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
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
-
.setHeight()
Sets the height of a dialog in pixels.
-
.setTitle()
Sets the title shown on a dialog or sidebar.
-
.createHtmlOutput()
Builds HTML output from a string for dialogs or sidebars.
-
.setSandboxMode()
Sets how much access client-side JavaScript has in the output.
-
.evaluate()
Renders a template into final HTML output.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about HtmlService.setWidth().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →Extract URLs from Google Sheets
Extract url from hyperlink google sheets.Skip the Command K. This Google Sheet tutorial will make it easier for you to extract URLS from Google Sheets.
Read post →