Sidechair

table.set_frame_width()

Browse the reference

Sets the pixel thickness of the outline around a table; 0 draws no outline.

Try it in the editor

0 removes the frame and larger values draw a heavier outline in the frame color. The inner grid is controlled by table.set_border_width() instead.

Setting the width from a condition makes the outline appear only when something is worth noticing.

Syntax

Pine Script
table.set_frame_width(table_id: series table, frame_width: series int (optional)) -> void
table.set_frame_width(frame_width: series int (optional)) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table whose outline changes thickness.
frame_widthseries int0Thickness of the outline in pixels. 0, the default, draws none, whatever the frame color is.

Returns

Nothing.

Example

Pine ScriptA frame that appears on a volume spikeOpen in editor
//@version=6
indicator("table.set_frame_width: spike frame", overlay = true)
spike = volume > ta.sma(volume, 20) * 2
var t = table.new(position.top_left, 1, 1, frame_color = color.orange)
if barstate.islast
    table.cell(t, 0, 0, "Volume")
    table.set_frame_width(t, spike ? 3 : 0)

See also

Runs on Sidechair