Class Column
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
ستون یک ستون
برای برنامههای Google Chat و افزونههای Google Workspace موجود است.
const columnWidget = CardService.newTextParagraph();
const column =
CardService.newColumn()
.setHorizontalSizeStyle(
CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE)
.setHorizontalAlignment(CardService.HorizontalAlignment.CENTER)
.setVerticalAlignment(CardService.VerticalAlignment.CENTER)
.addWidget(columnWidget);
مستندات دقیق
set Horizontal Alignment(horizontalAlignment)
Horizontal Alignment
Column
را تنظیم می کند. اختیاری.
const column = CardService.newColumn().setHorizontalAlignment(
CardService.HorizontalAlignment.CENTER,
);
پارامترها
بازگشت
Column
- این شی، برای زنجیر کردن.
set Horizontal Size Style(horizontalSizeStyle)
Horizontal Size Style
ستون را تنظیم می کند. اختیاری.
const column = CardService.newColumn().setHorizontalSizeStyle(
CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE,
);
پارامترها
بازگشت
Column
- این شی، برای زنجیر کردن.
set Vertical Alignment(verticalAlignment)
Vertical Alignment
Column
را تنظیم می کند. اختیاری.
const column = CardService.newColumn().setVerticalAlignment(
CardService.VerticalAlignment.CENTER,
);
پارامترها
بازگشت
Column
- این شی، برای زنجیر کردن.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eA column is a UI element available for Google Chat apps and Google Workspace Add-ons used to arrange widgets vertically within a card.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can add various widgets like text paragraphs, images, buttons, and input fields to a column using the \u003ccode\u003eaddWidget()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eColumns offer customization options for horizontal and vertical alignment, as well as horizontal size, through methods like \u003ccode\u003esetHorizontalAlignment()\u003c/code\u003e, \u003ccode\u003esetVerticalAlignment()\u003c/code\u003e, and \u003ccode\u003esetHorizontalSizeStyle()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eWidgets within a column are displayed in the order they are added using the \u003ccode\u003eaddWidget\u003c/code\u003e method, allowing for structured layout design.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esetHorizontalAlignment\u003c/code\u003e, \u003ccode\u003esetHorizontalSizeStyle\u003c/code\u003e, and \u003ccode\u003esetVerticalAlignment\u003c/code\u003e methods are optional and can be used to fine-tune the appearance and layout behavior of the column.\u003c/p\u003e\n"]]],["The core content describes how to use a `Column` within Google Chat apps and Workspace add-ons. Key actions involve creating a `Column` using `CardService.newColumn()`, adding various widgets like `TextParagraph` or `Image` using `addWidget()`, and setting alignment and size styles. `setHorizontalAlignment()`, `setHorizontalSizeStyle()`, and `setVerticalAlignment()` allow for adjusting the column's layout. The method `addWidget` allow adding widget, the order of the widget will be the display order.\n"],null,["# Class Column\n\nColumn\n\nA column.\n\nAvailable for Google Chat apps and Google Workspace add-ons.\n\n```javascript\nconst columnWidget = CardService.newTextParagraph();\nconst column =\n CardService.newColumn()\n .setHorizontalSizeStyle(\n CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE)\n .setHorizontalAlignment(CardService.HorizontalAlignment.CENTER)\n .setVerticalAlignment(CardService.VerticalAlignment.CENTER)\n .addWidget(columnWidget);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------------------------------|-------------|--------------------------------------------------------------------------------------------------------------|\n| [addWidget(widget)](#addWidget(Widget)) | [Column](#) | Adds a widget to the column. |\n| [setHorizontalAlignment(horizontalAlignment)](#setHorizontalAlignment(HorizontalAlignment)) | [Column](#) | Sets the [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) of the [Column](#). |\n| [setHorizontalSizeStyle(horizontalSizeStyle)](#setHorizontalSizeStyle(HorizontalSizeStyle)) | [Column](#) | Sets the [HorizontalSizeStyle](/apps-script/reference/card-service/horizontal-size-style) of the Column. |\n| [setVerticalAlignment(verticalAlignment)](#setVerticalAlignment(VerticalAlignment)) | [Column](#) | Sets the [VerticalAlignment](/apps-script/reference/card-service/vertical-alignment) of the [Column](#). |\n\nDetailed documentation\n----------------------\n\n### `add``Widget(widget)`\n\nAdds a widget to the column.\n\nWidgets are displayed in the order they are added. You can add the following widgets to a\ncolumn:\n\n- [TextParagraph](/apps-script/reference/card-service/text-paragraph)\n- [Image](/apps-script/reference/card-service/image)\n- [DecoratedText](/apps-script/reference/card-service/decorated-text)\n- [ButtonSet](/apps-script/reference/card-service/button-set)\n- [TextInput](/apps-script/reference/card-service/text-input)\n- [SelectionInput](/apps-script/reference/card-service/selection-input)\n- [DateTimePicker](/apps-script/reference/card-service/date-time-picker)\n\n```javascript\nconst column = CardService.newColumn().addWidget(\n CardService.newTextParagraph().setText('This is a text paragraph widget'),\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------|----------------------------------|\n| `widget` | [Widget](/apps-script/reference/card-service/widget) | The widget to add to the column. |\n\n#### Return\n\n\n[Column](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Horizontal``Alignment(horizontalAlignment)`\n\nSets the [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) of the [Column](#). Optional.\n\n```javascript\nconst column = CardService.newColumn().setHorizontalAlignment(\n CardService.HorizontalAlignment.CENTER,\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------------------|---------------------------------------------------------------------------------|-----------------------------------------|\n| `horizontal``Alignment` | [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) | The horizontal alignment of the column. |\n\n#### Return\n\n\n[Column](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Horizontal``Size``Style(horizontalSizeStyle)`\n\nSets the [HorizontalSizeStyle](/apps-script/reference/card-service/horizontal-size-style) of the Column. Optional.\n\n```javascript\nconst column = CardService.newColumn().setHorizontalSizeStyle(\n CardService.HorizontalSizeStyle.FILL_AVAILABLE_SPACE,\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------------------|----------------------------------------------------------------------------------|------------------------------------|\n| `horizontal``Size``Style` | [HorizontalSizeStyle](/apps-script/reference/card-service/horizontal-size-style) | The horizontal size of the column. |\n\n#### Return\n\n\n[Column](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Vertical``Alignment(verticalAlignment)`\n\nSets the [VerticalAlignment](/apps-script/reference/card-service/vertical-alignment) of the [Column](#). Optional.\n\n```javascript\nconst column = CardService.newColumn().setVerticalAlignment(\n CardService.VerticalAlignment.CENTER,\n);\n```\n\n#### Parameters\n\n| Name | Type | Description |\n|-----------------------|-----------------------------------------------------------------------------|---------------------------------------|\n| `vertical``Alignment` | [VerticalAlignment](/apps-script/reference/card-service/vertical-alignment) | The vertical alignment of the column. |\n\n#### Return\n\n\n[Column](#) --- This object, for chaining."]]