Class Column

Column

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

add Widget(widget)

Adds a widget to the column.

Widgets are displayed in the order they are added. You can add the following widgets to a column:

 const 
  
 column 
  
 = 
  
 CardService 
 . 
 newColumn 
 (). 
 addWidget 
 ( 
  
 CardService 
 . 
 newTextParagraph 
 (). 
 setText 
 ( 
 'This is a text paragraph widget' 
 ), 
 ); 

Parameters

Name Type Description
widget
Widget The widget to add to the column.

Return

Column — This object, for chaining.


set Horizontal Alignment(horizontalAlignment)

Sets the Horizontal Alignment of the Column . Optional.

 const 
  
 column 
  
 = 
  
 CardService 
 . 
 newColumn 
 (). 
 setHorizontalAlignment 
 ( 
  
 CardService 
 . 
 HorizontalAlignment 
 . 
 CENTER 
 , 
 ); 

Parameters

Name Type Description
horizontal Alignment
Horizontal Alignment The horizontal alignment of the column.

Return

Column — This object, for chaining.


set Horizontal Size Style(horizontalSizeStyle)

Sets the Horizontal Size Style of the Column. Optional.

 const 
  
 column 
  
 = 
  
 CardService 
 . 
 newColumn 
 (). 
 setHorizontalSizeStyle 
 ( 
  
 CardService 
 . 
 HorizontalSizeStyle 
 . 
 FILL_AVAILABLE_SPACE 
 , 
 ); 

Parameters

Name Type Description
horizontal Size Style
Horizontal Size Style The horizontal size of the column.

Return

Column — This object, for chaining.


set Vertical Alignment(verticalAlignment)

Sets the Vertical Alignment of the Column . Optional.

 const 
  
 column 
  
 = 
  
 CardService 
 . 
 newColumn 
 (). 
 setVerticalAlignment 
 ( 
  
 CardService 
 . 
 VerticalAlignment 
 . 
 CENTER 
 , 
 ); 

Parameters

Name Type Description
vertical Alignment
Vertical Alignment The vertical alignment of the column.

Return

Column — This object, for chaining.

Design a Mobile Site
View Site in Mobile | Classic
Share by: