Class TableRow
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
BảngHàng
Một hàng trong bảng. Một hàng bao gồm danh sách các ô trong bảng. Một hàng được xác định bằng chỉ mục hàng.
Tài liệu chi tiết
getCell(cellIndex)
Trả về ô tại chỉ mục được chỉ định.
Tham số
Tên | Loại | Mô tả |
cellIndex | Integer | Chỉ mục bắt đầu từ 0 của ô cần truy xuất. |
Cầu thủ trả bóng
TableCell
– ô.
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getIndex()
Trả về chỉ mục dựa trên 0 của hàng.
Cầu thủ trả bóng
Integer
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getMinimumHeight()
Trả về chiều cao tối thiểu của hàng tính bằng điểm. Chiều cao thực tế phụ thuộc vào độ dài của nội dung trong ô.
Cầu thủ trả bóng
Number
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getNumCells()
Trả về số ô trong hàng này.
Cầu thủ trả bóng
Integer
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
getParentTable()
Trả về bảng chứa hàng hiện tại.
Cầu thủ trả bóng
Table
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
remove()
Xoá hàng trong bảng.
Nếu tất cả các ô trong hàng được hợp nhất với các hàng khác, thì các hàng chung mà các ô này trải dài sẽ bị xoá.
Nếu không còn hàng nào trong bảng sau khi xoá hàng này, thì toàn bộ bảng sẽ bị xoá.
Ủy quyền
Các tập lệnh sử dụng phương thức này yêu cầu được uỷ quyền với một hoặc nhiều phạm vi sau:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eA \u003ccode\u003eTableRow\u003c/code\u003e represents a row within a table in Google Slides, comprised of a list of table cells and identified by its index.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access and manipulate \u003ccode\u003eTableRow\u003c/code\u003e objects using methods like \u003ccode\u003egetCell()\u003c/code\u003e, \u003ccode\u003egetIndex()\u003c/code\u003e, \u003ccode\u003egetMinimumHeight()\u003c/code\u003e, \u003ccode\u003egetNumCells()\u003c/code\u003e, \u003ccode\u003egetParentTable()\u003c/code\u003e, and \u003ccode\u003eremove()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTableRow\u003c/code\u003e methods allow for retrieving specific cells, obtaining row properties (index, minimum height, number of cells), accessing the parent table, and removing the row entirely.\u003c/p\u003e\n"],["\u003cp\u003eUsing these methods requires authorization with specific scopes related to Google Presentations.\u003c/p\u003e\n"]]],["A table row, identified by its index, contains a list of cells. Key actions include: retrieving a specific cell by its index (`getCell`), obtaining the row's index (`getIndex`), getting the minimum row height (`getMinimumHeight`), determining the number of cells (`getNumCells`), finding the parent table (`getParentTable`), and removing the row (`remove`). Removing a row may also remove merged or even the whole table if necessary. Accessing these methods requires specific authorization scopes.\n"],null,["# Class TableRow\n\nTableRow\n\nA row in a table. A row consists of a list of table cells. A row is identified by the row index. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------------------|-------------------------------------------------------|--------------------------------------------------|\n| [getCell(cellIndex)](#getCell(Integer)) | [TableCell](/apps-script/reference/slides/table-cell) | Returns the cell at the specified index. |\n| [getIndex()](#getIndex()) | `Integer` | Returns the 0-based index of the row. |\n| [getMinimumHeight()](#getMinimumHeight()) | `Number` | Returns the minimum height of the row in points. |\n| [getNumCells()](#getNumCells()) | `Integer` | Returns the number of cells in this row. |\n| [getParentTable()](#getParentTable()) | [Table](/apps-script/reference/slides/table) | Returns the table containing the current row. |\n| [remove()](#remove()) | `void` | Removes the table row. |\n\nDetailed documentation\n----------------------\n\n### `get``Cell(cellIndex)`\n\nReturns the cell at the specified index.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------------|-----------|--------------------------------------------|\n| `cell``Index` | `Integer` | The 0-based index of the cell to retrieve. |\n\n#### Return\n\n\n[TableCell](/apps-script/reference/slides/table-cell) --- the cell.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Index()`\n\nReturns the 0-based index of the row.\n\n#### Return\n\n\n`Integer`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Minimum``Height()`\n\nReturns the minimum height of the row in points. The actual height depends on the length of the\ncontent of the cell.\n\n#### Return\n\n\n`Number`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Num``Cells()`\n\nReturns the number of cells in this row.\n\n#### Return\n\n\n`Integer`\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `get``Parent``Table()`\n\nReturns the table containing the current row.\n\n#### Return\n\n\n[Table](/apps-script/reference/slides/table)\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`\n\n*** ** * ** ***\n\n### `remove()`\n\nRemoves the table row.\n\nIf all the cells in the row are merged with other rows, the common rows spanned by these\ncells are removed.\n\nIf no rows remain in the table after this removal, the whole table is removed.\n\n#### Authorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/presentations.currentonly`\n- `https://www.googleapis.com/auth/presentations`"]]