✅ Tables

Org-mode tables provide spreadsheet-like functionality directly in your text documents. Scimax VS Code supports creating, editing, navigating, and calculating with tables.

✅ Creating Tables

✅ Manual Creation

Type a table using pipe characters (|) as column separators:

NameAgeCity
Alice30New York
Bob25Boston

When you press Tab after entering content, the table auto-aligns.

✅ Table Creation Command

Press C-c | or use scimax.table.create to insert a table template.

You'll be prompted for the number of columns and rows.

✅ Converting Text to Table

Select comma-separated or tab-separated text, then use C-c | to convert it to a table.

1,2 3,4

leads to

12
34

✅ Table Navigation

✅ Moving Between Cells

KeyAction
Move to next cell (creates row at end)
S-Move to previous cell
Arrow keysMove in that direction

✅ Quick Navigation

CommandDescription
scimax.table.nextCellGo to next cell
scimax.table.prevCellGo to previous cell
scimax.table.gotoNamedJump to a named table

✅ Editing Tables

✅ Adding/Removing Rows

Key/CommandKey BindingAction
scimax.table.insertRowAboveM-S-UpInsert row above current
scimax.table.insertRowBelowM-S-DownInsert row below current
scimax.table.deleteRowM-S-BackspaceDelete current row

✅ Adding/Removing Columns

Key/CommandKey BindingAction
scimax.table.insertColumnRightM-S-RightInsert column to the right
scimax.table.insertColumnLeftM-S-LeftInsert column to the left
scimax.table.deleteColumnDelete current column

✅ Moving Rows/Columns

CommandKey BindingAction
scimax.table.moveRowUpS-upMove row up
scimax.table.moveRowDownS-downMove row down
scimax.table.moveColumnLeftS-leftMove column left
scimax.table.moveColumnRightS-rightMove column right

✅ Separator Lines

Insert horizontal separator lines to divide table sections:

KeyAction
C-c -Insert separator line (---+---)

Example with separators:

| Item     | Price |
|----------+-------|
| Widget A | 10.00 |
| Widget B | 15.00 |
|----------+-------|
| Total    | 25.00 |

✅ Table Alignment

✅ Automatic Alignment

Tables auto-align when you press Tab. Column widths adjust to fit content.

✅ Column Width Specification

Specify fixed column widths using in a cell:

Long text you don't want showing all ofShort
More longMore
<5>
Long text you don't want showing all ofShort
More longMore

Text exceeding the width is truncated in display (but preserved internally).

✅ Horizontal Alignment

Specify alignment using , , or :

Left alignedCenter textRight aligned
More leftCenteredMore right
MarkerAlignment
Left
Center
Right

Combine with width: for left-aligned, 10 characters wide.

✅ Table Formulas

Tables can include formulas for calculations, similar to spreadsheets.

Formula Line

Formulas are defined in a #+TBLFM: line below the table:

ItemQtyPriceTotal
Apples101.5015
Oranges52.0010
Sum25

Cell References

Column References

ReferenceMeaning
$1First column
$2Second column
$NNth column
$0Current column
$+1Next column (relative)
$-2Two columns back (relative)
$<First column
$>Last column
$#Total number of columns

Row References

ReferenceMeaning
@1First row
@2Second row
@NNth row
@0Current row
@+1Next row (relative)
@-1Previous row (relative)
@<First row
@>Last row
@IFirst hline
@IISecond hline
@IIIThird hline
@#Total number of data rows

Combined References

ReferenceMeaning
@2$3Row 2, column 3
@3$>Row 3, last column
@>$4Last row, column 4
@0$0Current cell
@0$3Current row, column 3
@2$0Row 2, current column
@+1$-1Relative reference

Ranges

ReferenceMeaning
@2\(1..@5\)1Column 1, rows 2 through 5
@2\(1..@2\)4Row 2, columns 1 through 4
@2\(1..@5\)4Rectangle from @2\(1 to @5\)4
\(2..\)5Columns 2-5 in current row

Formula Syntax

Formulas use the syntax: targetexpression=

,#+TBLFM: $4=$2*$3

This sets column 4 to the product of columns 2 and 3.

Multiple formulas separated by :::

,#+TBLFM: $4=$2*$3::@>$4=vsum(@2$4..@-1$4)

Built-in Functions

FunctionDescription
vsumSum of values in range
vmeanAverage of values
vminMinimum value
vmaxMaximum value
vcountCount of values
vprodProduct of values
sdevStandard deviation

Example:

Value
10
20
30
60

Recalculating Formulas

Key/CommandAction
C-c C-c (on TBLFM)Recalculate all formulas
scimax.table.recalculateRecalculate table

Place your cursor on the #+TBLFM: line and press C-c C-c to apply all formulas.

Formula Examples

Row Formula

Calculate total for each row:

ItemQ1Q2Q3Q4Total
Sales10203040100
Costs58121540

Column Formula

Sum a column:

MonthRevenue
Jan10000
Feb12000
Mar15000
Total37000

✅ Percentage Calculation

CategoryAmountPercent
A50050%
B30030%
C20020%
Total1000100

✅ Named Parameters and Constants

Named parameters let you use meaningful names instead of cell references.

Table Parameters ($ rows)

Define parameters directly in the table using a row where cells contain $namevalue= assignments:

$tax=0.08$discount=0.10
Price0
100108
200216

The $tax and $discount values are extracted from the first row and can be used as $tax and $discount in formulas.

Document Constants (#+CONSTANTS:)

Define constants at the document level using the #+CONSTANTS: keyword:

,#+CONSTANTS: pi=3.14159 e=2.71828 tax_rate=0.075

Then use them in any table formula in the document:

RadiusArea
578.54
10314.16

Multiple #+CONSTANTS: lines can be used; all constants are combined.

Column Names

Header row values can be used as column references. Given:

PriceQuantityTotal
10550
20360

Column names are case-insensitive.

✅ Duration and Time Calculations

Tables can calculate with time/duration values in HH:MM or HH:MM:SS format.

✅ Duration Format Flags

FlagOutput FormatExample
;THH:MM:SS2:30:00
;UHH:MM (no seconds)2:30
;tDecimal hours2.50

✅ Duration Calculation Example

TaskStartEndDuration
Coding9:0012:303:30
Meeting13:0014:151:15
Review14:3016:001:30
Total42:45

Duration values are automatically parsed when the T, U, or t flag is present. They are converted to seconds for calculation, then formatted according to the flag.

✅ Time Tracking Example

DateHours
2026-01-208:30
2026-01-217:45
2026-01-229:00
Total25:15
Avg8.42

✅ Remote Table References

Reference cells from other named tables in the document:

RegionRate
US0.10
EU0.20
RegionRevenueTax
US1000100
EU2000400

The remote(tablename, reference) function retrieves a value from another table named with #+NAME:.

✅ Formula Highlighting

Toggle formula highlighting to visualize which cells are affected by formulas:

CommandDescription
scimax.table.toggleFormulaHighlightToggle formula cell highlighting

When enabled:

  • Green highlight: Cells that are targets of formulas (will be calculated)

  • Blue highlight: Cells that are referenced in formulas (source values)

  • Yellow highlight: The #+TBLFM line itself

✅ Format Specifiers

Control how formula results are displayed:

SpecifierDescriptionExample Result
;%.2f2 decimal places3.14
;%dInteger3
;%.0f%%Percentage50%
;%eScientific notation3.14e+00
;TDuration as HH:MM:SS1:30:00
;UDuration as HH:MM1:30
;tDuration as decimal hrs1.50

✅ Table Import/Export

✅ Importing Tables

Import data from CSV files:

CommandDescription
scimax.table.importImport table from file

The import command will prompt for the file path and delimiter.

Exporting Tables

Key/CommandDescription
C-c C-e tExport table
scimax.table.exportExport table to file

Export formats:

  • CSV (comma-separated values)

  • TSV (tab-separated values)

  • Other delimited formats

✅ Column Operations

Perform quick calculations on columns:

CommandDescription
scimax.table.sumColumnSum values in current column
scimax.table.averageColumnAverage of current column

✅ Sorting

Key/CommandDescription
C-c ^Sort table by current column
scimax.table.sortByColumnSort by column

Sorting options:

  • Alphabetic (A-Z or Z-A)

  • Numeric (ascending or descending)

CategoryAmount
Supplies5000
Travel10000
Salaries50000

✅ Named Tables

Give tables names for reference:

CategoryAmount
Salaries50000
Supplies5000
Travel10000

Named tables can be:

  • Referenced in other source blocks

  • Jumped to with `scimax.table.gotoNamed'

  • Used as input for calculations

✅ Table Appearance in Export

✅ HTML Export

Tables export as HTML <table> elements with proper styling.

✅ LaTeX Export

Tables export as LaTeX tabular environments:

\begin{tabular}{llr}
Name & Age & City \\
\hline
Alice & 30 & New York \\
Bob & 25 & Boston \\
\end{tabular}

✅ Markdown Export

Tables export in GitHub-flavored Markdown format:

| Name  | Age | City     |
|-------|-----|----------|
| Alice | 30  | New York |
| Bob   | 25  | Boston   |

✅ Best Practices

✅ Table Design

  1. Use headers - Always include a header row with column names

  2. Add separators - Use |---| lines to separate headers from data

  3. Align numbers right - Numeric columns are easier to read right-aligned

  4. Keep columns focused - One type of data per column

✅ Formula Organization

  1. Comment complex formulas - Add explanations for non-obvious calculations

  2. Build incrementally - Test formulas one at a time

  3. Use named tables - For tables referenced elsewhere

✅ Large Tables

For large datasets:

  1. Consider using source blocks with pandas/R for complex analysis

  2. Import data rather than typing manually

  3. Export results to tables for presentation

✅ Quick Reference

Keybindings

KeyAction
C-c \vert{}Create table
Next cell / align
S-Previous cell
C-c -Insert separator
M-Insert row below
M-S-RightInsert column right
M-S-BackspaceDelete row
C-c ^Sort by column
C-c C-cRecalculate (on TBLFM)
C-c C-e tExport table

Commands

CommandDescription
scimax.table.createCreate new table
scimax.table.insertRowAboveInsert row above
scimax.table.insertRowBelowInsert row below
scimax.table.deleteRowDelete current row
scimax.table.insertColumnRightInsert column right
scimax.table.deleteColumnDelete current column
scimax.table.moveRowUpMove row up
scimax.table.moveRowDownMove row down
scimax.table.moveColumnLeftMove column left
scimax.table.moveColumnRightMove column right
scimax.table.recalculateRecalculate formulas
scimax.table.sumColumnSum current column
scimax.table.averageColumnAverage current column
scimax.table.sortByColumnSort by current column
scimax.table.exportExport table
scimax.table.importImport table
scimax.table.gotoNamedGo to named table
scimax.table.insertColumnFormulaInsert column formula
scimax.table.insertFieldFormulaInsert field formula
scimax.table.formulaHelpShow formula reference
scimax.table.toggleFormulaHighlightToggle formula highlighting

Navigation