Access and modify bandings, the color patterns applied to rows or columns of a range. Each banding consists of a range and a set of colors for rows, columns, headers, and footers.
Methods
Method | Return type | Brief description |
---|---|---|
copyTo(range) | Banding | Copies this banding to another range. |
getFirstColumnColor() | String | Returns the first column color that is alternating, or null if no color is set. |
getFirstRowColor() | String | Returns the first row color that is alternating or null if no color is set. |
getFooterColumnColor() | String | Returns the color of the last column, or null if no color is set. |
getFooterRowColor() | String | Returns the color of the last row, or null if no color is set. |
getHeaderColumnColor() | String | Returns the color of the header column, or null if no color is set. |
getHeaderRowColor() | String | Returns the color of the header row or null if no color is set. |
getRange() | Range | Returns the range for this banding. |
getSecondColumnColor() | String | Returns the second column color that is alternating, or null if no color is set. |
getSecondRowColor() | String | Returns the second row color that is alternating or null if no color is set. |
remove() | void | Removes this banding. |
setFirstColumnColor(color) | Banding | Sets the first column color that is alternating. |
setFirstRowColor(color) | Banding | Sets the first row color that is alternating. |
setFooterColumnColor(color) | Banding | Sets the color of the last column. |
setFooterRowColor(color) | Banding | Sets the color of the last row. |
setHeaderColumnColor(color) | Banding | Sets the color of the header column. |
setHeaderRowColor(color) | Banding | Sets the color of the header row. |
setRange(range) | Banding | Sets the range for this banding. |
setSecondColumnColor(color) | Banding | Sets the second column color that is alternating. |
setSecondRowColor(color) | Banding | Sets the second row color that is alternating. |
Detailed documentation
copyTo(range)
Copies this banding to another range.
Parameters
Name | Type | Description |
---|---|---|
range | Range | The range to copy this banding to. |
Return
Banding
— the new banding
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstColumnColor()
Returns the first column color that is alternating, or null
if no color is set.
Return
String
— the color code in CSS notation (such as '#ffffff'
or 'white'
), or
null
if no color is set
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getFirstRowColor()
Returns the first row color that is alternating or null
if no color is set.
Return
String
— the color code in CSS notation (such as '#ffffff'
or 'white'
), or
null
if no color is set
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderColumnColor()
Returns the color of the header column, or null
if no color is set.
Return
String
— the color code in CSS notation (such as '#ffffff'
or 'white'
), or
null
if no color is set
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getHeaderRowColor()
Returns the color of the header row or null
if no color is set.
Return
String
— the color code in CSS notation (such as '#ffffff'
or 'white'
), or
null
if no color is set
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getRange()
getSecondColumnColor()
Returns the second column color that is alternating, or null
if no color is set.
Return
String
— the HEX color or null
if no color is set
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
getSecondRowColor()
Returns the second row color that is alternating or null
if no color is set.
Return
String
— the color code in CSS notation (such as '#ffffff'
or 'white'
), or
null
if no color is set
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
remove()
Removes this banding.
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstColumnColor(color)
Sets the first column color that is alternating.
Parameters
Name | Type | Description |
---|---|---|
color | String | The color code in CSS notation (such as '#ffffff' or 'white' ), or
null to clear the color.. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setFirstRowColor(color)
Sets the first row color that is alternating.
Parameters
Name | Type | Description |
---|---|---|
color | String | The color code in CSS notation (such as '#ffffff' or 'white' ), or
null to clear the color. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setHeaderColumnColor(color)
Sets the color of the header column.
Parameters
Name | Type | Description |
---|---|---|
color | String | The color code in CSS notation (such as '#ffffff' or 'white' ), or
null to clear the color. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setHeaderRowColor(color)
Sets the color of the header row.
Parameters
Name | Type | Description |
---|---|---|
color | String | The color code in CSS notation (such as '#ffffff' or 'white' ), or
null to clear the color. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setRange(range)
Sets the range for this banding.
Parameters
Name | Type | Description |
---|---|---|
range | Range | The new range for this banding. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondColumnColor(color)
Sets the second column color that is alternating.
Parameters
Name | Type | Description |
---|---|---|
color | String | The color code in CSS notation (such as '#ffffff' or 'white' ), or
null to clear the color. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
setSecondRowColor(color)
Sets the second row color that is alternating.
Parameters
Name | Type | Description |
---|---|---|
color | String | The color code in CSS notation (such as '#ffffff' or 'white' ), or
null to clear the color. |
Return
Banding
— this banding, for chaining
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets