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(), and setVerticalAlignment().

  • 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 HorizontalAlignment of the Column. Optional.

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

Parameters

NameTypeDescription
horizontalAlignmentHorizontalAlignmentThe horizontal alignment of the column.

Return

Column — This object, for chaining.


setHorizontalSizeStyle(horizontalSizeStyle)

Sets the HorizontalSizeStyle of the Column. Optional.

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

Parameters

NameTypeDescription
horizontalSizeStyleHorizontalSizeStyleThe horizontal size of the column.

Return

Column — This object, for chaining.


setVerticalAlignment(verticalAlignment)

Sets the VerticalAlignment of the Column. Optional.

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

Parameters

NameTypeDescription
verticalAlignmentVerticalAlignmentThe vertical alignment of the column.

Return

Column — This object, for chaining.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-03 UTC.