Sidechair

table.set_border_width()

Browse the reference

Sets how many pixels thick the inner grid lines are; 0 turns the grid off.

Try it in the editor

0 hides the inner grid and 1 draws hairlines. All inner lines share one width. The frame around the table has its own width, set with table.set_frame_width().

A line also needs a visible color, so pair a width above 0 with table.set_border_color() or the border_color argument of table.new().

Syntax

Pine Script
table.set_border_width(table_id: series table, border_width: series int (optional)) -> void
table.set_border_width(border_width: series int (optional)) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table whose inner grid lines change thickness.
border_widthseries int0Thickness of the lines between cells in pixels. 0, the default, draws no inner grid.

Returns

Nothing.

Example

Pine ScriptA grid thickness sliderOpen in editor
//@version=6
indicator("table.set_border_width: grid slider", overlay = true)
w = input.int(1, "Grid thickness", minval = 0, maxval = 4)
var t = table.new(position.bottom_right, 2, 2, border_color = color.gray)
if barstate.islast
    table.cell(t, 0, 0, "A")
    table.cell(t, 1, 1, "B")
    table.set_border_width(t, w)

See also

Runs on Sidechair