Orgmode - Table

Introduction

Orgmode provides a minor mode orgtbl-mode, which makes table creating and editing extremely easy.

Any line with | as the first non-whitespace character is treated as a part of a table.

The fastest way to create a table is to directly type |Column1|Column2|Column3 followed by C-c RET. Then a 3-column table will be created immediately, with the head of Column1, Column2, and Column3 respectively.

Keybinding

KeybindingFunctionality
C-c |Convert the active region to a table.
C-c SPCClear the current cell.
C-c C-cRe-align the table.
TABRe-align the table move to the next column.
S-TABRe-align the table move to the previous column.
M-aMove the beginning of the current cell, or on to the previous cell.
M-eMove the end of the current cell, or on to the next cell.
RETRe-align the table and move to the next row.
M-left/rightMove the current column left/right.
M-up/downMove the current row up/down.
M-S-leftKill the current column.
M-S-upKill the current row.
M-S-rightInsert a new column to the right.
M-S-downInsert a new row above.
C-c -Insert a horizontal line below.
C-u C-c -Insert a horizontal line above.
C-c +Sum the numbers in the current column, or a active region.

Alignment and width

  • <l>, <r>, and <c> can align the column at point to the left, right, and center respectively.
  • <N> can fix the width of the column at point to N characters.

Reference

SymbolReference
@rr-th row
$cc-th column
@r$cThe cell in r-th row c-th column
@r1..@r2The rows from r1 to r2
$c1..$c2The columns from c1 to c2
Table of Contents