Sidechair

table.cell_set_text_valign()

Browse the reference

Places a cell's text against its top edge, center or bottom edge.

Try it in the editor

text.align_top, text.align_center and text.align_bottom set where the text sits in the cell's height. It matters once the row is taller than the text, for example after table.cell_set_height().

Giving every cell in a row the same value keeps text of different sizes on a shared line.

Syntax

Pine Script
table.cell_set_text_valign(table_id: series table, column: series int, row: series int, text_valign: series string (optional)) -> void
table.cell_set_text_valign(column: series int, row: series int, text_valign: series string (optional)) -> void

Arguments

NameTypeDefaultDescription
table_idseries tablerequiredThe table that holds the cell whose text is aligned.
columnseries intrequiredColumn of the cell whose text is aligned, counting from 0 at the left.
rowseries intrequiredRow of the cell whose text is aligned, counting from 0 at the top.
text_valignseries stringtext.align_centerVertical placement: text.align_top, text.align_center (default) or text.align_bottom.

Returns

Nothing.

Example

Pine ScriptText at the bottom of a tall cellOpen in editor
//@version=6
indicator("table.cell_set_text_valign: bottom", overlay = true)
var t = table.new(position.top_right, 1, 1)
if barstate.islast
    table.cell(t, 0, 0, "Note", height = 8)
    table.cell_set_text_valign(t, 0, 0, text.align_bottom)

See also

Runs on Sidechair