Object Reference : Object View and Procedure Reference : Table
  
 
setfillcolor
Set the fill (background) color of the specified table cells.
Syntax
table_name.setfillcolor(cell_range) color_arg
where cell_range can take one of the following forms:
 
@all
Apply to all cells in the table.
cell
Cell identifier. You can identify cells using either the column letter and row number (e.g., “A1”), or by using “R” followed by the row number followed by “C” and the column number (e.g., “R1C2”).
row[,] col
Row number, followed by column letter or number (e.g., “2,C”, or “2,3”), separated by “,”. Apply to cell.
row
Row number (e.g., “2”). Apply to all cells in the row.
col
Column letter (e.g., “B”). Apply to all cells in the column.
first_cell[:]last_cell, first_cell[,]last_cell
Top left cell of the selection range (specified in “cell” format), followed by bottom right cell of the selection range (specified in “cell” format), separated by a “:” or “,” (e.g., “A2:C10”, “A2,C10”, or “R2C1:R10C3”, “R2C1,R10C3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
first_cell_row[,] first_cell_col[,] last_cell_row[,] last_cell_col
Top left cell of the selection range (specified in “row[,] col” format), followed by bottom right cell of the selection range (specified in “row[,] col” format), separated by a “,” (e.g., “2,A,10,C” or “2,1,10,3”). Apply to all cells in the rectangular region defined by the first cell and last cell.
The color_arg specifies the color to be applied to the text in the cells. The color may be specified using predefined color names, or by specifying the individual red-green-blue (RGB) components using the special “@RGB” function. The latter method is obviously more difficult, but allows you to use custom colors.
The predefined colors are given by the keywords (with their RGB equivalents):
 
blue
@rgb(0, 0, 255)
red
@rgb(255, 0, 0)
green
@rgb(0, 128, 0)
black
@rgb(0, 0, 0)
white
@rgb(255, 255, 255)
purple
@rgb(128, 0, 128)
orange
@rgb(255, 128, 0)
yellow
@rgb(255, 255, 0)
gray
@rgb(128, 128, 128)
ltgray
@rgb(192, 192, 192)
Examples
To set a purple background color for the cell in the second row and third column of TAB1, you may use any of the following:
tab1.setfillcolor(C2) @rgb(128, 0, 128)
tab1.setfillcolor(2,C) @RGB(128, 0, 128)
tab1.setfillcolor(2,3) purple
tab1.setfillcolor(r2c3) purple
You may also specify a yellow color for the background of an entire column, or an entire row,
tab1.setfillcolor(C) @RGB(255, 255, 0)
tab1.setfillcolor(2) yellow
or for the background of the cells in a rectangular region:
tab1.setfillcolor(R2C3:R3C6) ltgray
tab1.setfillcolor(2,C,3,F) @rgb(192, 192, 192)
tab1.setfillcolor(2,3,3,6) @rgb(192, 192, 192)
Cross-references
See Table::settextcolor and Table::setfont for details on changing text color and font, and Table::setlines for drawing lines between and through cells.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See also “Table and Text Objects” for a discussion and examples of table formatting in EViews.