Class Column
-
Columns are available for Google Chat apps and Google Workspace add-ons.
-
You can add various widgets like TextParagraph, Image, and TextInput to a column using the
addWidget()method. -
The appearance of a column can be customized using methods like
setHorizontalAlignment(),setHorizontalSizeStyle(), andsetVerticalAlignment(). -
Each method returns the Column object for chaining.
A column.
Available for Google Chat apps and Google Workspace add-ons.
const columnWidget = CardService.newTextParagraph(); const column = CardService.newColumn() .setHorizontalSizeStyle( CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE) .setHorizontalAlignment(CardService.HorizontalAlignment.CENTER) .setVerticalAlignment(CardService.VerticalAlignment.CENTER) .addWidget(columnWidget);
Detailed documentation
setHorizontalAlignment(horizontalAlignment)
Sets the Horizontal of the Column. Optional.
const column = CardService.newColumn().setHorizontalAlignment( CardService.HorizontalAlignment.CENTER, );
Parameters
| Name | Type | Description |
|---|---|---|
horizontal | Horizontal | The horizontal alignment of the column. |
Return
Column — This object, for chaining.
setHorizontalSizeStyle(horizontalSizeStyle)
Sets the Horizontal of the Column. Optional.
const column = CardService.newColumn().setHorizontalSizeStyle( CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE, );
Parameters
| Name | Type | Description |
|---|---|---|
horizontal | Horizontal | The horizontal size of the column. |
Return
Column — This object, for chaining.
setVerticalAlignment(verticalAlignment)
Sets the Vertical of the Column. Optional.
const column = CardService.newColumn().setVerticalAlignment( CardService.VerticalAlignment.CENTER, );
Parameters
| Name | Type | Description |
|---|---|---|
vertical | Vertical | The vertical alignment of the column. |
Return
Column — This object, for chaining.