Places a cell's text against its left edge, center or right edge.
text.align_left, text.align_center and text.align_right position the text inside the cell. The choice only shows when the cell is wider than its text, for instance after setting a width.
Right-align a column of numbers so the digits line up under each other.
Syntax
table.cell_set_text_halign(table_id: series table, column: series int, row: series int, text_halign: series string (optional)) -> void
table.cell_set_text_halign(column: series int, row: series int, text_halign: series string (optional)) -> voidArguments
| Name | Type | Default | Description |
|---|---|---|---|
| table_id | series table | required | The table that holds the cell whose text is aligned. |
| column | series int | required | Column of the cell whose text is aligned, counting from 0 at the left. |
| row | series int | required | Row of the cell whose text is aligned, counting from 0 at the top. |
| text_halign | series string | text. | Horizontal placement: text.align_left, text.align_center (default) or text.align_right. |
Returns
Nothing.
Example
//@version=6
indicator("table.cell_set_text_halign: right", overlay = true)
var t = table.new(position.top_right, 1, 1)
if barstate.islast
table.cell(t, 0, 0, str.tostring(close, "#.##"), width = 10)
table.cell_set_text_halign(t, 0, 0, text.align_right)See also
Runs on Sidechair