setColumnWidth

sets the width of spreadsheet columns

void setColumnWidth(id|array id,number|string width, [string page] );
id
id|arraythe column id or an array of ids width
number|stringthe width in pixels or "auto" page
stringoptional, the name of the sheet

Example

$$("ssheet1").setColumnWidth(columnId, 120, "Sheet1");

Details

In order to adjust the width of a column to its content, pass "auto" to the method as the second parameter:

$$("ssheet1").setColumnWidth(columnId, "auto");

Note that the width:auto setting will work for the active sheet only.

You can pass an array of ids as the first parameter like this:

$$("ssheet1").setColumnWidth([3, 6], "auto");

In this case the columns from 3 to 6 will adjust their width to the content inside.

See also
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
    If you have not checked yet, be sure to visit site of our main product Webix best ui framework and page of spreadsheet product.