Class TableColumn
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ảngCột
Một cột trong bảng. Cột bao gồm danh sách các ô trong bảng. Cột được xác định bằng chỉ mục cột.
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 bắt đầu từ 0 của cột.
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
getNumCells()
Trả về số ô trong cột 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 cột 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
getWidth()
Trả về chiều rộng của cột tính bằng điểm.
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
remove()
Xoá cột trong bảng.
Nếu tất cả các ô trong cột được hợp nhất với các cột khác, thì các cột chung mà các ô này trải dài sẽ bị xoá.
Nếu không còn cột nào trong bảng sau khi xoá cột 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 TableColumn represents a column within a Google Slides table, comprised of a list of TableCells and identified by its column index.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can access and manipulate TableColumns using methods like getCell(), getIndex(), getNumCells(), getParentTable(), getWidth(), and remove().\u003c/p\u003e\n"],["\u003cp\u003eThese methods allow for retrieving specific cells, determining column index and size, identifying the parent table, and removing the column entirely.\u003c/p\u003e\n"],["\u003cp\u003eEach method requires specific authorization scopes, typically 'https://www.googleapis.com/auth/presentations.currentonly' or 'https://www.googleapis.com/auth/presentations', to interact with Google Slides presentations.\u003c/p\u003e\n"],["\u003cp\u003eRemoving a TableColumn with merged cells may remove common spanned columns and potentially the entire table if no columns remain.\u003c/p\u003e\n"]]],["A `TableColumn` represents a column in a table, composed of `TableCell`s, identified by its index. Key actions include retrieving a specific cell via `getCell(cellIndex)`, obtaining the column's index with `getIndex()`, and determining the number of cells using `getNumCells()`. Other methods include getting the parent table via `getParentTable()`, getting the column's width in points using `getWidth()`, and removing the column using `remove()`. Removal may lead to the deletion of the entire table.\n"],null,["# Class TableColumn\n\nTableColumn\n\nA column in a table. A column consists of a list of table cells. A column is identified by the\ncolumn 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 column. |\n| [getNumCells()](#getNumCells()) | `Integer` | Returns the number of cells in this column. |\n| [getParentTable()](#getParentTable()) | [Table](/apps-script/reference/slides/table) | Returns the table containing the current column. |\n| [getWidth()](#getWidth()) | `Number` | Returns the width of the column in points. |\n| [remove()](#remove()) | `void` | Removes the table column. |\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)\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 column.\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``Num``Cells()`\n\nReturns the number of cells in this column.\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 column.\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### `get``Width()`\n\nReturns the width of the column in points.\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### `remove()`\n\nRemoves the table column.\n\nIf all the cells in the column are merged with other columns, the common columns spanned by\nthese cells are removed.\n\nIf no columns 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`"]]