Sets the color of the inner grid lines that separate the cells of a table.
The border is the grid inside the table; the outer edge is the frame, set with table.set_frame_color(). Changing the color does not switch the grid on: the lines stay hidden while the border width is 0.
Because the call can run on any bar, the grid can carry a signal, for example turning green above a moving average and red below it.
Syntax
table.set_border_color(table_id: series table, border_color: series color (optional)) -> void
table.set_border_color(border_color: series color (optional)) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| table_id | series table | required | The table whose inner grid lines are recolored. |
| border_color | series color | na | Color of the lines between cells. na is transparent, so the grid disappears even when its width is above 0. |
Returns
Nothing.
Example
//@version=6
indicator("table.set_border_color: trend grid", overlay = true)
trendUp = close > ta.sma(close, 20)
var t = table.new(position.bottom_right, 2, 2, border_width = 1)
if barstate.islast
table.cell(t, 0, 0, "A")
table.cell(t, 1, 1, "B")
table.set_border_color(t, trendUp ? color.green : color.red)See also
Runs on Sidechair