Sidechair

table.cell_set_height()

Browse the reference

Sets a cell's height as a percent of the chart height; 0 lets the text decide.

Try it in the editor

A value of 5 makes the cell a twentieth of the chart's height. 0 restores automatic height, sized to the text.

Cells in one row share a height. A very small value on an empty, filled cell turns a row into a thin divider between two blocks of text.

Syntax

Pine Script
table.cell_set_height(table_id: series table, column: series int, row: series int, height: series int/float (optional)) -> void
table.cell_set_height(column: series int, row: series int, height: series int/float (optional)) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table that holds the cell whose height is set.
columnseries intrequiredColumn of the cell whose height is set, counting from 0 at the left.
rowseries intrequiredRow of the cell whose height is set, counting from 0 at the top.
heightseries int/float0Height as a percent of the chart height, for example 5. 0, the default, fits the text.

Returns

Nothing.

Example

Pine ScriptA thin divider row between two readingsOpen in editor
//@version=6
indicator("table.cell_set_height: divider row", overlay = true)
var t = table.new(position.top_left, 1, 3)
if barstate.islast
    table.cell(t, 0, 0, "Range")
    table.cell(t, 0, 1, "", bgcolor = color.gray)
    table.cell_set_height(t, 0, 1, 0.5)
    table.cell(t, 0, 2, str.tostring(high - low, "#.##"))

See also

Runs on Sidechair