col
| Property is read-only. It cannot be set in script. |
|
Returns the column index of the cell currently referenced by a Format expression script. For example, if you specify a ‘Color’ expression in the Format panel for a detail cell in a Table, you can use the col property within the script to obtain the index of the column. This, together with table array and the row property allow you to construct relative references to other cells in the Table.
See Control Properties with Expression for information about how to use expressions to set properties.
Example
The script below can be used in a ‘Color’ or ‘Background’ expression to set color formatting on a Table detail cell. It assigns a red color if the value in the cell is less than the value of the same cell in the row above, and assigns a green color otherwise.
if (row > 1) {
if (value < table[row-1][col]) {
[255,0,0]
}
else {
[0,255,0]
}
}