Aa 0.14.1

Tables

A table is GitHub’s Markdown table, written cell by cell, with its first row as its header.

A table

Tab moves to the next cell and Enter leaves the table. ⌘/ has Add row and Add column.

What it stores

Choose Table in the slash menu for a table of two columns, with a header row and one empty row. Write in a cell; Tab moves to the next and Shift-Tab to the one before. Tab in the last cell, or Enter in any, leaves the table for a new paragraph under it.

With the caret in a table, ⌘/ opens the block’s commands with Add row, Delete row, Add column and Delete column. A row is added under the caret’s row and a column after its column. The header row is never deleted, and neither is a table’s only column.

| Room | Seats | Floor || --- | --- | --- || Lake | 8 | 1 |
What you seeHow you write itWhat it stores
A tableTable in the slash menu, or rows pasted from a spreadsheetA header row, a row of dashes, then a line a row
The headerThe first rowThe line above the dashes
A column set to its start, centre or endWrite it in the row of dashes:---, :---: or ---:

Each cell holds plain words. Markdown written in a cell is kept and shown as written, not formatted. A pipe written with a backslash before it stays part of its cell’s words, and pipes in cells Aa writes itself, from a paste or a new row or column, are given the backslash.

Columns set to their end

The second column is written ---:, so its figures stand at its end.

What it stores

The row of dashes sets each column: :--- to its start, :---: to its centre and ---: to its end. Every figure in a table is one width, so prices and counts in a column set to its end line up. Rows and columns added or deleted keep every column’s alignment.

A table is drawn as Design system 1’s prose draws one: each row two squares high, the words on one square with half a square round them, a hairline at each row’s foot, no box and no lines between columns. The header row is set in the medium face.

A selection can run over several cells. Bold, colour and the other marks then go on each cell’s words on their own, and deleting or typing empties the cells and leaves the columns where they are. What is typed goes in the first cell. A link or an equation stays within one cell.

Rows copied from a spreadsheet arrive as text with tabs between the cells. Pasted into the writing, they become a table. Pasted into a table, they fill its cells from the caret’s cell on, to the right and down, adding rows and columns where the table runs out. ⌘⇧V pastes them as plain text.

KeysWhat they do
Tab, Shift-TabThe next cell, or the one before
Tab in the last cellA new paragraph under the table
EnterA new paragraph under the table
Left at a cell’s start, Right at its endThe cell before or after
Up, DownThe cell above or below
Backspace in an empty rowRemoves the row, the caret going to the row above
Backspace in an empty tableRemoves the table
Backspace with every cell selectedRemoves the table
Backspace at the start of a cell in a row with wordsNothing: a cell’s edge holds
⌘AThe cell’s words, then all of the writing
⌘/The block’s commands, with the rows and columns

From code, editor.table('add-row') and its siblings delete-row, add-column and delete-column act at the caret’s cell. writeTable, tableRows and fromTSV read and write tables outside the editor. See Methods and events.