Class Divider
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Divider
가로 구분선 부가기능 카드에 구분자를 추가하려면 CardService
내에서 newDivider()
메서드를 사용하세요. 예를 들어 다음 샘플은 구분자로 구분된 두 개의 단락이 있는 간단한 카드를 빌드합니다.
function buildCard() {
const cardSection1TextParagraph1 =
CardService.newTextParagraph().setText('Hello world!');
const cardSection1Divider1 = CardService.newDivider();
const cardSection1TextParagraph2 =
CardService.newTextParagraph().setText('Hello world!');
const cardSection1 = CardService.newCardSection()
.addWidget(cardSection1TextParagraph1)
.addWidget(cardSection1Divider1)
.addWidget(cardSection1TextParagraph2);
const card = CardService.newCardBuilder().addSection(cardSection1).build();
return card;
}
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eHorizontal dividers are visual elements used to separate content within an add-on card for better readability.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003enewDivider()\u003c/code\u003e method within the \u003ccode\u003eCardService\u003c/code\u003e class to create a divider element.\u003c/p\u003e\n"],["\u003cp\u003eDividers can be added to card sections along with other widgets like text paragraphs.\u003c/p\u003e\n"]]],[],null,["# Class Divider\n\nDivider\n\nA horizontal divider. To add a divider to your add-on card, use the `new``Divider()`\nmethod within [CardService](/apps-script/reference/card-service/card-service). For example, the following sample builds a simple card with 2\nparagraphs separated by a divider.\n\n```javascript\nfunction buildCard() {\n const cardSection1TextParagraph1 =\n CardService.newTextParagraph().setText('Hello world!');\n\n const cardSection1Divider1 = CardService.newDivider();\n\n const cardSection1TextParagraph2 =\n CardService.newTextParagraph().setText('Hello world!');\n\n const cardSection1 = CardService.newCardSection()\n .addWidget(cardSection1TextParagraph1)\n .addWidget(cardSection1Divider1)\n .addWidget(cardSection1TextParagraph2);\n\n const card = CardService.newCardBuilder().addSection(cardSection1).build();\n\n return card;\n}\n```"]]