Class Banding
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Banding
存取及修改帶狀間隔,也就是套用至範圍內資料列或資料欄的顏色模式。每個帶狀區由範圍和一組資料列、資料欄、標題和頁尾的顏色組成。
內容詳盡的說明文件
copyTo(range)
將此帶狀效果複製到其他範圍。
參數
| 名稱 | 類型 | 說明 |
range | Range | 要將此條紋複製到的範圍。 |
回攻員
Banding:新分級制度。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstColumnColorObject()
傳回帶狀區的第一個交替欄顏色,如果未設定顏色,則傳回 null。
回攻員
Color|null:帶狀區隔中的第一個交替欄顏色,如果未設定顏色,則為 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColorObject()
傳回第一個交替資料列顏色,如果未設定任何顏色,則傳回 null。
回攻員
Color|null:帶狀區隔中的第一個交替資料列顏色,如果未設定顏色,則為 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColorObject()
傳回帶狀區第一欄的顏色,如果未設定顏色,則傳回 null。
回攻員
Color|null:帶狀區的第一欄顏色,如果未設定顏色,則為 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange()
傳回此頻帶的範圍。
回攻員
Range:這個頻帶的範圍。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondColumnColorObject()
傳回帶狀區的第二個交替欄顏色,如果未設定顏色,則傳回 null。
回攻員
Color|null:帶狀區的第二個交替欄顏色,或未設定顏色時的 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColorObject()
傳回第二個交替列顏色,如果未設定顏色,則傳回 null。
回攻員
Color|null:帶狀區的第二個交替列顏色,如果未設定顏色,則為 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
remove()
移除此條紋。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstColumnColor(color)
設定交替的第一個資料欄顏色。
參數
| 名稱 | 類型 | 說明 |
color | String | CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstColumnColorObject(color)
設定帶狀區隔中的第一個替代欄顏色。
參數
| 名稱 | 類型 | 說明 |
color | Color | 帶狀區隔中新的第一個交替欄顏色;設為 null
會清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstRowColor(color)
設定交替的第一列顏色。
參數
| 名稱 | 類型 | 說明 |
color | String | CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstRowColorObject(color)
設定帶狀區隔中的第一個替代列顏色。
參數
| 名稱 | 類型 | 說明 |
color | Color | 帶狀顯示的新第一種交替顏色;設為 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setHeaderColumnColor(color)
設定標題欄的顏色。
參數
| 名稱 | 類型 | 說明 |
color | String | CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setHeaderColumnColorObject(color)
設定標題欄的顏色。
參數
| 名稱 | 類型 | 說明 |
color | Color | 新的標題欄顏色;設為 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRange(range)
設定此頻帶的範圍。
參數
| 名稱 | 類型 | 說明 |
range | Range | 這個分級的新範圍。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondColumnColor(color)
設定交替的第二欄顏色。
參數
| 名稱 | 類型 | 說明 |
color | String | CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondColumnColorObject(color)
設定帶狀區的第二個替代欄顏色。
參數
| 名稱 | 類型 | 說明 |
color | Color | 帶狀區的第二個交替資料欄顏色;設為 null
可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondRowColor(color)
設定交替的第二列顏色。
參數
| 名稱 | 類型 | 說明 |
color | String | CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondRowColorObject(color)
設定帶狀區域的第二個交替顏色。
參數
| 名稱 | 類型 | 說明 |
color | Color | 帶狀顯示的第二個交替顏色;設為 null 可清除顏色。 |
回攻員
Banding - This banding, for chaining.
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
已淘汰的方法
getFirstColumnColor()
已淘汰。已替換為 getFirstColumnColorObject()
傳回交替的第一個欄顏色,如果未設定任何顏色,則傳回 null。
回攻員
String|null:CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或未設定顏色時的 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColor()
已淘汰。已替換為 getFirstRowColorObject()
傳回交替的第一個資料列顏色,或未設定顏色時傳回 null。
回攻員
String|null:CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或未設定顏色時的 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColor()
已淘汰。已替換為 getHeaderColumnColorObject()
傳回標題欄的顏色,如果未設定顏色,則傳回 null。
回攻員
String|null:CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或未設定顏色時的 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
已淘汰。已替換為 getHeaderRowColorObject()
傳回標題列的顏色,如果未設定顏色,則傳回 null。
回攻員
String|null:CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或未設定顏色時的 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondColumnColor()
已淘汰。已替換為 getSecondColumnColorObject()
傳回交替的第二欄顏色,如果未設定顏色,則傳回 null。
回攻員
String|null:十六進位顏色或 null (如未設定顏色)。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColor()
已淘汰。已替換為 getSecondRowColorObject()
傳回交替的第二列顏色,或 null (如果未設定顏色)。
回攻員
String|null:CSS 標記中的顏色代碼 (例如 '#ffffff' 或 'white'),或未設定顏色時的 null。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-12-11 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-12-11 (世界標準時間)。"],[],[]]