Table cell block (cell). Renders as <td> or <th>; editing happens in nested text lines (data-rx-tag="tbr"). Column width and nowrap apply to the whole column; cells are serialized via the parent table grid.
Type: cell · Class: CellBlock
Access:
app.block.get()
app.blocks.findByEl(el)
app.blocks.create(type)
App code:
const block = app.block.get();
Plugin:
const block = this.app.block.get();
getWidth#
Returns the width attribute value of the cell element (empty string when unset).
Returns: string
block.getWidth();
getNowrap#
Returns whether the cell has the nowrap CSS class (rx-nowrap or the configured table.nowrap class).
Returns: boolean
block.getNowrap();
getTable#
Returns the closest parent <table> element for this cell.
Returns: HTMLElement | null
block.getTable();
setWidth#
Sets the width attribute on this cell and all cells in the same column. Strips px; preserves % values.
Parameters:
- value (
any) — value to store
Returns: void
block.setWidth('25%');
setNowrap#
Adds or removes nowrap CSS classes on this cell and all cells in the same column.
Parameters:
- value (
any) — value to store
Returns: void
block.setNowrap(true);