TableCellBackground

New in version 5.0

TableCellBackground ( cellIndices ;​ fillColor ;​ fillColorVariant )

Argument Type Range Default Note
cellIndices int[] -1000..1000 0 0...all
fillColor rgba 0..255 white
fillColorVariant int -1..128 solid
Examples

TableCellBackground(1 2 1 -1;​#88f)

Description

Cells are referenced by the row and column index. For example:

TableCellBackground( 5 3;​yellow) /* Cell in row 5, column 3. */

TableCellBackground( 5 -1;​yellow) /* Cell in row 5, last column. */

TableCellBackground(-1 -1;​yellow) /* Cell in last row, last column. */

TableCellBackground( 5 -2;​yellow) /* Cell in row 5, second last column. */

TableCellBackground(-3 -2;​yellow) /* Cell in third last row, second last column. */

A range of cells is referenced by listing the upper-left cell of the range, followed by the lower-right cell, i.e. [fromRow fromColumn toRow toColumn ... ]. For example:

TableCellBackground( 1 2 3 2;​yellow) /* Range from cell(1,2) to cell(3,2). */

TableCellBackground( 1 1 1 -1;​yellow) /* Row 1. */

TableCellBackground( 2 1 2 -1;​yellow) /* Row 2. */

TableCellBackground( 2 1 5 -1;​yellow) /* Rows 2 to 5. */

TableCellBackground(-1 1 -1 -1;​yellow) /* Last row. */

TableCellBackground(-2 1 -1 -1;​yellow) /* Last 2 rows. */

TableCellBackground(1 1 -1 1;​yellow) /* Column 1. */

TableCellBackground(1 2 -1 2;​yellow) /* Column 2. */

TableCellBackground(1 2 -1 5;​yellow) /* Column 2 to 5. */

TableCellBackground(1 -1 -1 -1;​yellow) /* Last column. */

TableCellBackground(1 -2 -1 -1;​yellow) /* Last 2 columns. */

Multiple cell ranges can be defined in one function call. For example:

TableCellBackground(1 1 1 -1 /* First row.  */

-1 1 -1 -1;​yellow) /* Last row.  */

TableCellBackground(1 1 -1 1 /* First column. */

1 -1 -1 -1;​yellow) /* Last column.  */

Short form:
0...means all cells. For example:

TableCellBackground(0;​yellow) /* All rows and columns. */

TABLE_CELL_BACKGROUND_01
1

OpenDrawing(300;​130)

2

OpenTable(0;​0;​left;​top)

3

TableTexts("";​"10\t1,234.21\t712\n25\t93.42\t3949\n268\t234.20\t6854\n185\t-1,692.21\t•••\n124\t198.50\t1000")

4

TableCellStyle(0;​Verdana;​15;​plain;​black) /* 0..all cells. */

5

TableColumnAlignments(right;​right;​right)

6

TableColumnWidths(0;​100;​80) /* 1st column: 0...automatic column width. */

7

TableCellBackground(-1 -1;​#ff0a) /* -1...last row, -1...last colum. */

8

CloseTable()

9

CloseDrawing()

TABLE_CELL_BACKGROUND_01
TABLE_CELL_BACKGROUND_02
1

OpenDrawing(300;​130)

2

OpenTable(0;​0;​left;​top)

3

TableTexts("";​"10\t1,234.21\t712\n25\t93.42\t3949\n268\t234.20\t6854\n185\t-1,692.21\t•••\n124\t198.50\t1000")

4

TableCellStyle(0;​Verdana;​15;​plain;​black) /* 0..all cells. */

5

TableColumnAlignments(right;​right;​right)

6

TableColumnWidths(0;​100;​80) /* 1st column: 0...automatic column width. */

7

TableCellBackground(2 1 2 -1;​#fcfc7a) /* Second row.  */

8

TableCellBackground(1 -1 -1 -1;​#fcfc7a) /* Last column. */

9

CloseTable()

10

CloseDrawing()

TABLE_CELL_BACKGROUND_02
Scroll to Top