องค์ประกอบที่แสดงถึงเซลล์ในตาราง TableCell
จะอยู่ใน TableRow
เสมอและอาจมีองค์ประกอบ ListItem
, Paragraph
หรือ Table
สําหรับข้อมูลเพิ่มเติมเกี่ยวกับโครงสร้างเอกสาร โปรดดูคู่มือการขยาย Google เอกสาร
เมธอด
วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
---|---|---|
appendHorizontalRule() | HorizontalRule | สร้างและต่อท้าย HorizontalRule ใหม่ |
appendImage(image) | InlineImage | สร้างและแนบ InlineImage ใหม่จาก BLOB ของรูปภาพที่ระบุ |
appendImage(image) | InlineImage | เพิ่ม InlineImage ที่ระบุ |
appendListItem(listItem) | ListItem | เพิ่ม ListItem ที่ระบุ |
appendListItem(text) | ListItem | สร้างและต่อท้าย ListItem ใหม่ |
appendParagraph(paragraph) | Paragraph | เพิ่ม Paragraph ที่ระบุ |
appendParagraph(text) | Paragraph | สร้างและต่อท้าย Paragraph ใหม่ |
appendTable() | Table | สร้างและต่อท้าย Table ใหม่ |
appendTable(cells) | Table | เพิ่ม Table ใหม่ซึ่งมีเซลล์ที่ระบุ |
appendTable(table) | Table | เพิ่ม Table ที่ระบุ |
clear() | TableCell | ล้างเนื้อหาขององค์ประกอบ |
copy() | TableCell | แสดงผลสําเนาเดี่ยวที่แยกองค์ประกอบปัจจุบัน |
editAsText() | Text | รับองค์ประกอบปัจจุบัน Text เวอร์ชันเพื่อแก้ไข |
findElement(elementType) | RangeElement | ค้นหาเนื้อหาขององค์ประกอบจากมากไปหาน้อยของประเภทที่ระบุ |
findElement(elementType, from) | RangeElement | ค้นหาเนื้อหาขององค์ประกอบในองค์ประกอบสืบทอดจากประเภทที่ระบุ โดยเริ่มจาก RangeElement ที่ระบุ |
findText(searchPattern) | RangeElement | ค้นหาเนื้อหาขององค์ประกอบในรูปแบบข้อความที่ระบุโดยใช้นิพจน์ทั่วไป |
findText(searchPattern, from) | RangeElement | ค้นหาเนื้อหาขององค์ประกอบสําหรับรูปแบบข้อความที่ระบุ เริ่มจากผลการค้นหาที่กําหนด |
getAttributes() | Object | ดึงแอตทริบิวต์ของ' |
getBackgroundColor() | String | เรียกดูสีพื้นหลัง |
getChild(childIndex) | Element | เรียกข้อมูลองค์ประกอบย่อยที่ดัชนีย่อยที่ระบุ |
getChildIndex(child) | Integer | เรียกข้อมูลดัชนีย่อยสําหรับองค์ประกอบย่อยที่ระบุ |
getColSpan() | Integer | เรียกข้อมูลช่วงคอลัมน์ ซึ่งเป็นจํานวนคอลัมน์ของเซลล์ในตารางที่เซลล์นี้ครอบคลุม |
getLinkUrl() | String | เรียก URL ของลิงก์ |
getNextSibling() | Element | เรียกองค์ประกอบข้างเคียงขององค์ประกอบถัดไป |
getNumChildren() | Integer | ดึงข้อมูลจํานวนบุตรหลาน |
getPaddingBottom() | Number | เรียกข้อมูลระยะห่างจากขอบด้านล่าง |
getPaddingLeft() | Number | เรียกข้อมูลระยะห่างจากขอบด้านซ้าย |
getPaddingRight() | Number | เรียกข้อมูลระยะห่างจากขอบด้านขวาในจุด |
getPaddingTop() | Number | เรียกข้อมูลระยะห่างจากขอบด้านบน |
getParent() | ContainerElement | เรียกองค์ประกอบหลักขององค์ประกอบ |
getParentRow() | TableRow | เรียกข้อมูล TableRow ที่มี TableCell ปัจจุบัน |
getParentTable() | Table | เรียกข้อมูล Table ที่มี TableCell ปัจจุบัน |
getPreviousSibling() | Element | เรียกองค์ประกอบระดับก่อนหน้าขององค์ประกอบ' |
getRowSpan() | Integer | เรียกข้อมูลช่วงแถวซึ่งเป็นจํานวนแถวของเซลล์ในตารางที่เซลล์นี้ครอบคลุม |
getText() | String | เรียกเนื้อหาขององค์ประกอบเป็นสตริงข้อความ |
getTextAlignment() | TextAlignment | รับการจัดข้อความ |
getType() | ElementType | เรียกดูองค์ประกอบ'ElementType |
getVerticalAlignment() | VerticalAlignment | เรียกข้อมูล VerticalAlignment |
getWidth() | Number | เรียกข้อมูลความกว้างของคอลัมน์ที่มีเซลล์เป็นจุด |
insertHorizontalRule(childIndex) | HorizontalRule | สร้างและแทรก HorizontalRule ใหม่ที่ดัชนีที่ระบุ |
insertImage(childIndex, image) | InlineImage | สร้างและแทรก InlineImage จาก BLOB ของรูปภาพที่ระบุที่ดัชนีที่ระบุ |
insertImage(childIndex, image) | InlineImage | แทรก InlineImage ที่ระบุที่ดัชนีที่ระบุ |
insertListItem(childIndex, listItem) | ListItem | แทรก ListItem ที่ระบุที่ดัชนีที่ระบุ |
insertListItem(childIndex, text) | ListItem | สร้างและแทรก ListItem ใหม่ที่ดัชนีที่ระบุ |
insertParagraph(childIndex, paragraph) | Paragraph | แทรก Paragraph ที่ระบุที่ดัชนีที่ระบุ |
insertParagraph(childIndex, text) | Paragraph | สร้างและแทรก Paragraph ใหม่ที่ดัชนีที่ระบุ |
insertTable(childIndex) | Table | สร้างและแทรก Table ใหม่ที่ดัชนีที่ระบุ |
insertTable(childIndex, cells) | Table | สร้างและแทรก Table ใหม่ที่มีเซลล์ที่ระบุที่ดัชนีที่ระบุ |
insertTable(childIndex, table) | Table | แทรก Table ที่ระบุที่ดัชนีที่ระบุ |
isAtDocumentEnd() | Boolean | กําหนดว่าองค์ประกอบอยู่ท้าย Document หรือไม่ |
merge() | TableCell | ผสานองค์ประกอบกับองค์ประกอบข้างเคียงประเภทเดียวกัน |
removeChild(child) | TableCell | นําองค์ประกอบย่อยที่ระบุออก |
removeFromParent() | TableCell | นําองค์ประกอบออกจากระดับบนสุด |
replaceText(searchPattern, replacement) | Element | แทนที่รูปแบบข้อความที่ระบุทั้งหมดด้วยสตริงแทนที่ที่ระบุโดยใช้นิพจน์ปกติ |
setAttributes(attributes) | TableCell | ตั้งค่าแอตทริบิวต์ขององค์ประกอบ |
setBackgroundColor(color) | TableCell | ตั้งค่าสีพื้นหลัง |
setLinkUrl(url) | TableCell | ตั้งค่า URL ของลิงก์ |
setPaddingBottom(paddingBottom) | TableCell | กําหนดระยะห่างจากขอบด้านล่างในจุด |
setPaddingLeft(paddingLeft) | TableCell | ตั้งค่าระยะห่างจากขอบด้านซ้ายในจุด |
setPaddingRight(paddingTop) | TableCell | กําหนดระยะห่างจากขอบด้านขวาในจุด |
setPaddingTop(paddingTop) | TableCell | ตั้งค่าระยะห่างจากขอบด้านบนเป็นจุด |
setText(text) | TableCell | ตั้งค่าเนื้อหาเป็นข้อความธรรมดา |
setTextAlignment(textAlignment) | TableCell | ตั้งค่าการจัดข้อความ |
setVerticalAlignment(alignment) | TableCell | ตั้งค่าการจัดข้อความแนวตั้ง |
setWidth(width) | TableCell | ตั้งค่าความกว้างของคอลัมน์ที่มีเซลล์ปัจจุบันเป็นจุด |
เอกสารประกอบโดยละเอียด
appendHorizontalRule()
สร้างและต่อท้าย HorizontalRule
ใหม่
HorizontalRule
จะอยู่ใน Paragraph
ใหม่
ไปกลับ
HorizontalRule
— กฎแนวนอนใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendImage(image)
สร้างและแนบ InlineImage
ใหม่จาก BLOB ของรูปภาพที่ระบุ
InlineImage
จะอยู่ใน Paragraph
ใหม่
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
image | BlobSource | ข้อมูลรูปภาพ |
ไปกลับ
InlineImage
— รูปภาพใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendImage(image)
เพิ่ม InlineImage
ที่ระบุ
InlineImage
จะอยู่ใน Paragraph
ใหม่
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
image | InlineImage | ข้อมูลรูปภาพ |
ไปกลับ
InlineImage
— รูปภาพที่ต่อท้าย
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendListItem(listItem)
เพิ่ม ListItem
ที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
listItem | ListItem | รายการที่จะต่อท้าย |
ไปกลับ
ListItem
— รายการที่ต่อท้าย
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendListItem(text)
appendParagraph(paragraph)
เพิ่ม Paragraph
ที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
paragraph | Paragraph | ย่อหน้าที่จะต่อท้าย |
ไปกลับ
Paragraph
— ย่อหน้าที่ต่อท้าย
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendParagraph(text)
appendTable()
appendTable(cells)
เพิ่ม Table
ใหม่ซึ่งมีเซลล์ที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
cells | String[][] | เนื้อหาข้อความของเซลล์ในตารางที่จะเพิ่มไปยังตารางใหม่ |
ไปกลับ
Table
— ตารางที่ต่อท้าย
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
appendTable(table)
clear()
copy()
แสดงผลสําเนาเดี่ยวที่แยกองค์ประกอบปัจจุบัน
ระบบจะคัดลอกองค์ประกอบย่อยที่แสดงในองค์ประกอบด้วย องค์ประกอบใหม่ไม่มีองค์ประกอบหลัก
ไปกลับ
TableCell
— สําเนาใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
editAsText()
รับองค์ประกอบปัจจุบัน Text
เวอร์ชันเพื่อแก้ไข
ใช้ editAsText
เพื่อจัดการเนื้อหาขององค์ประกอบเป็น Rich Text โหมด editAsText
จะไม่สนใจองค์ประกอบที่ไม่ใช่ข้อความ (เช่น InlineImage
และ HorizontalRule
)
ระบบจะนําองค์ประกอบย่อยทั้งหมดที่อยู่ในช่วงข้อความที่ลบแล้วออกจากองค์ประกอบ
var body = DocumentApp.getActiveDocument().getBody(); // Insert two paragraphs separated by a paragraph containing an // horizontal rule. body.insertParagraph(0, "An editAsText sample."); body.insertHorizontalRule(0); body.insertParagraph(0, "An example."); // Delete " sample.\n\n An" removing the horizontal rule in the process. body.editAsText().deleteText(14, 25);
ไปกลับ
Text
— เวอร์ชันข้อความขององค์ประกอบปัจจุบัน
findElement(elementType)
ค้นหาเนื้อหาขององค์ประกอบจากมากไปหาน้อยของประเภทที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
elementType | ElementType | ประเภทขององค์ประกอบที่จะค้นหา |
ไปกลับ
RangeElement
— ผลการค้นหาที่แสดงตําแหน่งขององค์ประกอบการค้นหา
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
findElement(elementType, from)
ค้นหาเนื้อหาขององค์ประกอบในองค์ประกอบสืบทอดจากประเภทที่ระบุ โดยเริ่มจาก RangeElement
ที่ระบุ
// Get the body section of the active document. var body = DocumentApp.getActiveDocument().getBody(); // Define the search parameters. var searchType = DocumentApp.ElementType.PARAGRAPH; var searchHeading = DocumentApp.ParagraphHeading.HEADING1; var searchResult = null; // Search until the paragraph is found. while (searchResult = body.findElement(searchType, searchResult)) { var par = searchResult.getElement().asParagraph(); if (par.getHeading() == searchHeading) { // Found one, update and stop. par.setText('This is the first header.'); return; } }
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
elementType | ElementType | ประเภทขององค์ประกอบที่จะค้นหา |
from | RangeElement | ผลการค้นหาที่ใช้ค้นหา |
ไปกลับ
RangeElement
— ผลการค้นหาที่แสดงตําแหน่งถัดไปขององค์ประกอบการค้นหา
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
findText(searchPattern)
ค้นหาเนื้อหาขององค์ประกอบในรูปแบบข้อความที่ระบุโดยใช้นิพจน์ทั่วไป
ระบบจะไม่รองรับฟีเจอร์นิพจน์ทั่วไปของ JavaScript บางรายการ เช่น แคปเจอร์กรุ๊ปและตัวแก้ไขโหมด
ระบบจะจับคู่รูปแบบนิพจน์ทั่วไปที่มีให้อย่างอิสระกับแต่ละบล็อกข้อความที่มีอยู่ในองค์ประกอบปัจจุบัน
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
searchPattern | String | รูปแบบที่จะค้นหา |
ไปกลับ
RangeElement
— ผลการค้นหาที่แสดงตําแหน่งของข้อความค้นหา หรือมีค่า Null หากไม่มีรายการที่ตรงกัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
findText(searchPattern, from)
ค้นหาเนื้อหาขององค์ประกอบสําหรับรูปแบบข้อความที่ระบุ เริ่มจากผลการค้นหาที่กําหนด
ระบบจะไม่รองรับฟีเจอร์นิพจน์ทั่วไปของ JavaScript บางรายการ เช่น แคปเจอร์กรุ๊ปและตัวแก้ไขโหมด
ระบบจะจับคู่รูปแบบนิพจน์ทั่วไปที่มีให้อย่างอิสระกับแต่ละบล็อกข้อความที่มีอยู่ในองค์ประกอบปัจจุบัน
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
searchPattern | String | รูปแบบที่จะค้นหา |
from | RangeElement | ผลการค้นหาที่ใช้ค้นหา |
ไปกลับ
RangeElement
— ผลการค้นหาที่แสดงตําแหน่งถัดไปของข้อความค้นหา หรือเป็นค่าว่างหากไม่ตรงกัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getAttributes()
ดึงแอตทริบิวต์ของ'
ผลลัพธ์คือออบเจ็กต์ที่มีพร็อพเพอร์ตี้สําหรับแอตทริบิวต์องค์ประกอบที่ถูกต้องแต่ละรายการ โดยที่ชื่อพร็อพเพอร์ตี้แต่ละรายการสอดคล้องกับรายการในการแจงนับ DocumentApp.Attribute
var body = DocumentApp.getActiveDocument().getBody(); // Append a styled paragraph. var par = body.appendParagraph('A bold, italicized paragraph.'); par.setBold(true); par.setItalic(true); // Retrieve the paragraph's attributes. var atts = par.getAttributes(); // Log the paragraph attributes. for (var att in atts) { Logger.log(att + ":" + atts[att]); }
ไปกลับ
Object
— แอตทริบิวต์'องค์ประกอบ
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getBackgroundColor()
เรียกดูสีพื้นหลัง
ไปกลับ
String
— สีพื้นหลังซึ่งจัดรูปแบบในรูปแบบ CSS (เช่น '#ffffff'
)
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getChild(childIndex)
เรียกข้อมูลองค์ประกอบย่อยที่ดัชนีย่อยที่ระบุ
// Get the body section of the active document. var body = DocumentApp.getActiveDocument().getBody(); // Obtain the first element in the document. var firstChild = body.getChild(0); // If it's a paragraph, set its contents. if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) { firstChild.asParagraph().setText("This is the first paragraph."); }
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีองค์ประกอบย่อยเพื่อดึง |
ไปกลับ
Element
— องค์ประกอบย่อยในดัชนีที่ระบุ
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getChildIndex(child)
เรียกข้อมูลดัชนีย่อยสําหรับองค์ประกอบย่อยที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
child | Element | องค์ประกอบย่อยที่จะดึงดัชนี |
ไปกลับ
Integer
— ดัชนีย่อย
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getColSpan()
เรียกข้อมูลช่วงคอลัมน์ ซึ่งเป็นจํานวนคอลัมน์ของเซลล์ในตารางที่เซลล์นี้ครอบคลุม เซลล์ที่ไม่มีการผสานมีช่วงของคอลัมน์เท่ากับ 1
ไปกลับ
Integer
— ช่วงคอลัมน์หรือ 0 ของเซลล์ที่ผสานกับเซลล์อื่น
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getLinkUrl()
เรียก URL ของลิงก์
ไปกลับ
String
— URL ของลิงก์ หรือค่า Null หากองค์ประกอบมีค่าหลายค่าสําหรับแอตทริบิวต์นี้
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getNextSibling()
เรียกองค์ประกอบข้างเคียงขององค์ประกอบถัดไป
พี่น้องถัดไปมีระดับบนสุดเดียวกันและเป็นไปตามองค์ประกอบปัจจุบัน
ไปกลับ
Element
— องค์ประกอบพี่น้องถัดไป
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getNumChildren()
ดึงข้อมูลจํานวนบุตรหลาน
// Get the body section of the active document. var body = DocumentApp.getActiveDocument().getBody(); // Log the number of elements in the document. Logger.log("There are " + body.getNumChildren() + " elements in the document body.");
ไปกลับ
Integer
— จํานวนบุตร
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPaddingBottom()
เรียกข้อมูลระยะห่างจากขอบด้านล่าง
ไปกลับ
Number
— ระยะห่างจากขอบล่างในจุด
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPaddingLeft()
เรียกข้อมูลระยะห่างจากขอบด้านซ้าย
ไปกลับ
Number
— ระยะห่างจากขอบด้านซ้าย
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPaddingRight()
เรียกข้อมูลระยะห่างจากขอบด้านขวาในจุด
ไปกลับ
Number
— ระยะห่างจากขอบด้านขวาในจุด
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getPaddingTop()
เรียกข้อมูลระยะห่างจากขอบด้านบน
ไปกลับ
Number
— ระยะห่างจากขอบบนสุด
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getParent()
เรียกองค์ประกอบหลักขององค์ประกอบ
องค์ประกอบระดับบนมีองค์ประกอบปัจจุบัน
ไปกลับ
ContainerElement
— องค์ประกอบระดับบน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getParentRow()
getParentTable()
getPreviousSibling()
เรียกองค์ประกอบระดับก่อนหน้าขององค์ประกอบ'
พี่น้องก่อนหน้านี้มีออบเจ็กต์หลักเดียวกันและอยู่ก่อนองค์ประกอบปัจจุบัน
ไปกลับ
Element
— องค์ประกอบข้างเคียงก่อนหน้า
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getRowSpan()
เรียกข้อมูลช่วงแถวซึ่งเป็นจํานวนแถวของเซลล์ในตารางที่เซลล์นี้ครอบคลุม เซลล์ที่ไม่มีการผสานมีช่วงแถวที่ 1
ไปกลับ
Integer
— ช่วงแถวหรือ 0 ของเซลล์ที่ผสานกับเซลล์อื่น
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getText()
เรียกเนื้อหาขององค์ประกอบเป็นสตริงข้อความ
ไปกลับ
String
— เนื้อหาขององค์ประกอบเป็นสตริงข้อความ
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getTextAlignment()
รับการจัดข้อความ ประเภทการตรวจสอบที่ตรงกันได้แก่ DocumentApp.TextAlignment.NORMAL
, DocumentApp.TextAlignment.SUBSCRIPT
และ DocumentApp.TextAlignment.SUPERSCRIPT
ไปกลับ
TextAlignment
— ประเภทของการจัดเรียงข้อความ หรือ null
หากข้อความมีการจัดเรียงข้อความหลายประเภท หรือหากไม่เคยมีการตั้งค่าการจัดเรียงข้อความ
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getType()
เรียกดูองค์ประกอบ'ElementType
ใช้ getType()
เพื่อระบุประเภทที่แน่นอนขององค์ประกอบที่ระบุ
var body = DocumentApp.getActiveDocument().getBody(); // Obtain the first element in the document body. var firstChild = body.getChild(0); // Use getType() to determine the element's type. if (firstChild.getType() == DocumentApp.ElementType.PARAGRAPH) { Logger.log('The first element is a paragraph.'); } else { Logger.log('The first element is not a paragraph.'); }
ไปกลับ
ElementType
— ประเภทขององค์ประกอบ
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getVerticalAlignment()
เรียกข้อมูล VerticalAlignment
ไปกลับ
VerticalAlignment
— การจัดข้อความแนวตั้ง
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
getWidth()
เรียกข้อมูลความกว้างของคอลัมน์ที่มีเซลล์เป็นจุด
ไปกลับ
Number
— ความกว้างของคอลัมน์เป็นจุด
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertHorizontalRule(childIndex)
สร้างและแทรก HorizontalRule
ใหม่ที่ดัชนีที่ระบุ
กฎแนวนอนจะอยู่ใน Paragraph
ใหม่
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
ไปกลับ
HorizontalRule
— กฎแนวนอนใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertImage(childIndex, image)
สร้างและแทรก InlineImage
จาก BLOB ของรูปภาพที่ระบุที่ดัชนีที่ระบุ
รูปภาพนี้จะอยู่ใน Paragraph
ใหม่
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
image | BlobSource | ข้อมูลรูปภาพ |
ไปกลับ
InlineImage
— รูปภาพที่แทรกในบรรทัด
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertImage(childIndex, image)
แทรก InlineImage
ที่ระบุที่ดัชนีที่ระบุ
รูปภาพนี้จะอยู่ใน Paragraph
ใหม่
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
image | InlineImage | รูปภาพที่จะแทรก |
ไปกลับ
InlineImage
— รูปภาพที่แทรกในบรรทัด
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertListItem(childIndex, listItem)
แทรก ListItem
ที่ระบุที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
listItem | ListItem | รายการที่จะแทรก |
ไปกลับ
ListItem
— แทรกรายการใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertListItem(childIndex, text)
สร้างและแทรก ListItem
ใหม่ที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
text | String | เนื้อหาข้อความ |
ไปกลับ
ListItem
— รายการใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertParagraph(childIndex, paragraph)
แทรก Paragraph
ที่ระบุที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
paragraph | Paragraph | ย่อหน้าที่จะแทรก |
ไปกลับ
Paragraph
— ย่อหน้าที่แทรก
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertParagraph(childIndex, text)
สร้างและแทรก Paragraph
ใหม่ที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
text | String | เนื้อหาข้อความ |
ไปกลับ
Paragraph
— ย่อหน้าใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertTable(childIndex)
สร้างและแทรก Table
ใหม่ที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
ไปกลับ
Table
— ตารางใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertTable(childIndex, cells)
สร้างและแทรก Table
ใหม่ที่มีเซลล์ที่ระบุที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรก |
cells | String[][] | เนื้อหาข้อความของเซลล์ในตารางที่จะเพิ่มไปยังตารางใหม่ |
ไปกลับ
Table
— ตารางใหม่
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
insertTable(childIndex, table)
แทรก Table
ที่ระบุที่ดัชนีที่ระบุ
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
childIndex | Integer | ดัชนีที่จะแทรกองค์ประกอบ |
table | Table | ตารางที่จะแทรก |
ไปกลับ
Table
— ตารางที่แทรกไว้
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
isAtDocumentEnd()
merge()
ผสานองค์ประกอบกับองค์ประกอบข้างเคียงประเภทเดียวกัน
ผสานได้เฉพาะองค์ประกอบของ ElementType
เดียวกัน องค์ประกอบย่อยที่อยู่ในองค์ประกอบปัจจุบันจะย้ายไปยังองค์ประกอบข้างเคียงก่อนหน้า
ระบบจะนําองค์ประกอบปัจจุบันออกจากเอกสาร
var body = DocumentApp.getActiveDocument().getBody(); // Example 1: Merge paragraphs // Append two paragraphs to the document. var par1 = body.appendParagraph('Paragraph 1.'); var par2 = body.appendParagraph('Paragraph 2.'); // Merge the newly added paragraphs into a single paragraph. par2.merge(); // Example 2: Merge table cells // Create a two-dimensional array containing the table's cell contents. var cells = [ ['Row 1, Cell 1', 'Row 1, Cell 2'], ['Row 2, Cell 1', 'Row 2, Cell 2'] ]; // Build a table from the array. var table = body.appendTable(cells); // Get the first row in the table. var row = table.getRow(0); // Get the two cells in this row. var cell1 = row.getCell(0); var cell2 = row.getCell(1); // Merge the current cell into its preceding sibling element. var merged = cell2.merge();
ไปกลับ
TableCell
— องค์ประกอบที่ผสาน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
removeChild(child)
นําองค์ประกอบย่อยที่ระบุออก
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
child | Element | องค์ประกอบย่อยที่จะนําออก |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
removeFromParent()
นําองค์ประกอบออกจากระดับบนสุด
var body = DocumentApp.getActiveDocument().getBody(); // Remove all images in the document body. var imgs = body.getImages(); for (var i = 0; i < imgs.length; i++) { imgs[i].removeFromParent(); }
ไปกลับ
TableCell
— องค์ประกอบที่นําออก
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
replaceText(searchPattern, replacement)
แทนที่รูปแบบข้อความที่ระบุทั้งหมดด้วยสตริงแทนที่ที่ระบุโดยใช้นิพจน์ปกติ
ระบบจะส่งรูปแบบการค้นหาเป็นสตริง ไม่ใช่ออบเจ็กต์นิพจน์ทั่วไปของ JavaScript ด้วยเหตุนี้ คุณจึงต้องหลีกแบ็กสแลชให้เป็นรูปแบบ
เมธอดนี้ใช้ไลบรารีนิพจน์ปกติ RE2 ของ Google ซึ่งจํากัดไวยากรณ์ที่รองรับ
ระบบจะจับคู่รูปแบบนิพจน์ทั่วไปที่มีให้อย่างอิสระกับแต่ละบล็อกข้อความที่มีอยู่ในองค์ประกอบปัจจุบัน
var body = DocumentApp.getActiveDocument().getBody(); // Clear the text surrounding "Apps Script", with or without text. body.replaceText("^.*Apps ?Script.*$", "Apps Script");
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
searchPattern | String | รูปแบบนิพจน์ทั่วไปที่จะค้นหา |
replacement | String | ข้อความที่จะใช้แทนที่ |
ไปกลับ
Element
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setAttributes(attributes)
ตั้งค่าแอตทริบิวต์ขององค์ประกอบ
พารามิเตอร์แอตทริบิวต์ที่ระบุต้องเป็นออบเจ็กต์ที่ชื่อพร็อพเพอร์ตี้แต่ละรายการเป็นรายการในการแจกแจง DocumentApp.Attribute
และค่าพร็อพเพอร์ตี้แต่ละรายการคือค่าใหม่ที่จะใช้
var body = DocumentApp.getActiveDocument().getBody(); // Define a custom paragraph style. var style = {}; style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] = DocumentApp.HorizontalAlignment.RIGHT; style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri'; style[DocumentApp.Attribute.FONT_SIZE] = 18; style[DocumentApp.Attribute.BOLD] = true; // Append a plain paragraph. var par = body.appendParagraph('A paragraph with custom style.'); // Apply the custom style. par.setAttributes(style);
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
attributes | Object | แอตทริบิวต์'s |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setBackgroundColor(color)
ตั้งค่าสีพื้นหลัง
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
color | String | สีพื้นหลังซึ่งจัดรูปแบบในรูปแบบ CSS (เช่น '#ffffff' ) |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setLinkUrl(url)
setPaddingBottom(paddingBottom)
กําหนดระยะห่างจากขอบด้านล่างในจุด
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
paddingBottom | Number | ระยะห่างจากขอบด้านล่าง |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setPaddingLeft(paddingLeft)
ตั้งค่าระยะห่างจากขอบด้านซ้ายในจุด
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
paddingLeft | Number | ระยะห่างจากขอบด้านซ้าย |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setPaddingRight(paddingTop)
กําหนดระยะห่างจากขอบด้านขวาในจุด
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
paddingTop | Number | ระยะห่างจากขอบด้านขวาในจุด |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setPaddingTop(paddingTop)
ตั้งค่าระยะห่างจากขอบด้านบนเป็นจุด
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
paddingTop | Number | ระยะห่างจากขอบด้านบนในจุด |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setText(text)
ตั้งค่าเนื้อหาเป็นข้อความธรรมดา
หมายเหตุ: ระบบจะล้างเนื้อหาที่มีอยู่
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
text | String | เนื้อหาข้อความใหม่ |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setTextAlignment(textAlignment)
ตั้งค่าการจัดข้อความ ประเภทการตรวจสอบที่ตรงกันได้แก่ DocumentApp.TextAlignment.NORMAL
, DocumentApp.TextAlignment.SUBSCRIPT
และ DocumentApp.TextAlignment.SUPERSCRIPT
// Make the entire first paragraph be superscript. var text = DocumentApp.getActiveDocument().getBody().getParagraphs()[0].editAsText(); text.setTextAlignment(DocumentApp.TextAlignment.SUPERSCRIPT);
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
textAlignment | TextAlignment | ประเภทของการจัดข้อความที่จะใช้ |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setVerticalAlignment(alignment)
ตั้งค่าการจัดข้อความแนวตั้ง
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
alignment | VerticalAlignment | การจัดข้อความแนวตั้ง |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents
setWidth(width)
ตั้งค่าความกว้างของคอลัมน์ที่มีเซลล์ปัจจุบันเป็นจุด
พารามิเตอร์
ชื่อ | ประเภท | คำอธิบาย |
---|---|---|
width | Number | ความกว้างของคอลัมน์เป็นจุด |
ไปกลับ
TableCell
— องค์ประกอบปัจจุบัน
การให้สิทธิ์
สคริปต์ที่ใช้วิธีนี้ต้องได้รับสิทธิ์กับขอบเขตต่อไปนี้อย่างน้อย 1 รายการ
-
https://www.googleapis.com/auth/documents.currentonly
-
https://www.googleapis.com/auth/documents