6. Working with Arrays, Table Fields, and Collections : Table Fields : Table Field Components : Individual Cells
 
Share this page                  
Individual Cells
You can access some of the visual characteristics of individual cells of an unnested table field by using the CellAttribute object. This object has a variety of attributes that control several of the visual characteristics of a cell. Note that because the size of a cell is always identical to the size of all cells in the same column, you cannot change any attributes that would affect the size of a CellAttribute attribute.
The syntax for changing individual cell attributes is:
field(tablefield[n].column).attribute = value
tablefield[n].column.attribute
Identifies a specific cell in row n of the array for the table field, and attribute is an attribute of the CellAttribute object
For example, the following statement changes the background color of the fourth cell in the name column of the custtable table:
field(custtable[4].name).bgcolor = CC_LIGHT_BLUE;
Because of the significant overhead entailed in their use, CellAttribute objects are not automatically created when a table field is created. CellAttributes can be turned on explicitly with the HasCellAttributes property. Or they are turned on implicitly by changing a single cell's attribute. They can be freed up by turning off HasCellAttributes, but this resets all attributes back to the protofield's default attributes.
There are no CellAttribute objects for the cells of nested table fields.