Sidechair

table.cell_set_text_size()

Browse the reference

Picks the text size of one cell, from size.tiny up to size.huge, or size.auto to scale with the cell.

Try it in the editor

Sizes step up through size.tiny, size.small, size.normal, size.large and size.huge. A large size suits a headline value and a small one the notes beneath it.

size.auto scales the text to the cell instead of using a fixed step, so it grows or shrinks with the cell's width and height.

Syntax

Pine Script
table.cell_set_text_size(table_id: series table, column: series int, row: series int, text_size: series int/string (optional)) -> void
table.cell_set_text_size(column: series int, row: series int, text_size: series int/string (optional)) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table that holds the cell whose text size changes.
columnseries intrequiredColumn of the cell whose text size changes, counting from 0 at the left.
rowseries intrequiredRow of the cell whose text size changes, counting from 0 at the top.
text_sizeseries int/stringsize.normalsize.auto, size.tiny, size.small, size.normal (default), size.large or size.huge.

Returns

Nothing.

Example

Pine ScriptAll five steps in one columnOpen in editor
//@version=6
indicator("table.cell_set_text_size: size steps", overlay = true)
var t = table.new(position.top_right, 1, 5)
if barstate.islast
    table.cell(t, 0, 0, "tiny")
    table.cell(t, 0, 1, "small")
    table.cell(t, 0, 2, "normal")
    table.cell(t, 0, 3, "large")
    table.cell(t, 0, 4, "huge")
    table.cell_set_text_size(t, 0, 0, size.tiny)
    table.cell_set_text_size(t, 0, 1, size.small)
    table.cell_set_text_size(t, 0, 2, size.normal)
    table.cell_set_text_size(t, 0, 3, size.large)
    table.cell_set_text_size(t, 0, 4, size.huge)

See also

Runs on Sidechair