GNU Emacs
Emacs
Dashboard

25.15.4 Commands for Table Cells

The commands M-x table-forward-cell and M-x table-backward-cell move point from the current cell to an adjacent cell. The order is cyclic: when point is in the last cell of a table, M-x table-forward-cell moves to the first cell. Likewise, when point is on the first cell, M-x table-backward-cell moves to the last cell.

M-x table-span-cell prompts for a direction—right, left, above, or below—and merges the current cell with the adjacent cell in that direction. This command signals an error if the merge would result in an illegitimate cell layout.

M-x table-split-cell splits the current cell vertically or horizontally, prompting for the direction with the minibuffer. To split in a specific direction, use M-x table-split-cell-vertically and M-x table-split-cell-horizontally. When splitting vertically, the old cell contents are automatically split between the two new cells. When splitting horizontally, you are prompted for how to divide the cell contents, if the cell is non-empty; the options are ‘ split’ (divide the contents at point), ‘ left’ (put all the contents in the left cell), and ‘ right’ (put all the contents in the right cell).

The following commands enlarge or shrink a cell. By default, they resize by one row or column; if a numeric argument is supplied, that specifies the number of rows or columns to resize by.

M-x table-heighten-cell

Enlarge the current cell vertically.

M-x table-shorten-cell

Shrink the current cell vertically.

M-x table-widen-cell

Enlarge the current cell horizontally.

M-x table-narrow-cell

Shrink the current cell horizontally.