Tables

Tables are a powerful feature for Text notes, since editing them is generally easy.

Article Image

To create a table, simply press the table button and select with the mouse the desired amount of columns and rows, as indicated in the adjacent figure.

Since v0.107.0, the same menu starts with an Insert table… item, for a table larger than the grid or to type its size instead:

  1. Click the button and select Insert table…. A small form opens at the cursor.
  2. Enter the number of Columns (up to 100) and Rows (up to 1000). The table can have at most 5000 cells in total, for example 1000 rows of 5 columns.
  3. Optionally, turn on Use headers and enter the number of Header columns and Header rows. A table cannot have more header columns or rows than it has columns or rows.
  4. Press Insert or Enter.

To close the form without inserting a table, press Esc or click outside it. From the keyboard, Tab moves between Insert table… and the grid while the menu is open.

On the Mobile Frontend, the table is inserted from the button of the formatting toolbar: its Insert table tile lists common sizes, from 2 × 2 to 3 × 4 (rows × columns). Tap one to insert a table of that size; to make it larger, insert rows and columns afterwards.

Formatting toolbar

When a table is selected, a special formatting toolbar will appear:

Article Image

On the Mobile Frontend, the toolbar does not float over the table. Instead, press the button after Undo and Redo in the formatting toolbar at the bottom of the screen to show the table's toolbar there.

Context menu

Since v0.106.0, right-clicking anywhere inside a table opens a context menu with the most common table operations:

  • Insert row above and Insert row below insert a blank row next to the row of the current cell. When the selection spans multiple rows, the same number of rows is inserted.
  • Insert column to the left and Insert column to the right work the same way for columns.
  • Since v0.107.0, Set as header or Set header up to this row, depending on the selection, turns rows into header rows, which always start at the top of the table:
    • Set as header shows when the selection starts at the first row, and makes every selected row a header row.
    • Set header up to this row shows when the selection is in a single row below the first, and makes that row and every row above it header rows.
    • Neither shows when the selection spans several rows below the first.
    • A check mark shows that the rows are already header rows. Choosing the item again turns them, and every header row below them, back into regular rows. For example, in a table with five header rows, choosing Set header up to this row on the third row leaves only the first two as header rows.
  • Merge cells merges the selected cells into one. The selected cells must form a rectangle.
  • Split cell splits each selected cell in two, either Vertically or Horizontally. Unmerge cells, in the same submenu, turns each merged cell in the selection back into the single cells it covers, keeping its content in the top-left one; cells that are not merged stay as they are.
  • Distribute columns evenly splits the combined width of the columns the selection touches equally between them. The other columns and the width of the table stay as they are. It needs a selection spanning at least two columns; a merged cell counts for every column it covers.
  • Cut, Copy and Copy as Markdown act on the selected cells. Since v0.107.0, Copy and Paste open submenus with their variants, such as Copy as Markdown and Paste as plain text; clicking Copy or Paste itself still copies or pastes:
    • Cutting or copying produces a smaller table holding just the selected cells. Pasting it over a cell selection replaces those cells; pasting elsewhere inserts it as a table of its own. Cutting clears the cells without removing rows or columns.
    • Copy as Markdown converts the selected cells to a Markdown table. A selected header row becomes the Markdown header; without one, an empty header row is emitted, since Markdown tables require one.
  • Since v0.107.0, Paste rows above and Paste rows below, in the Paste submenu, paste the clipboard as new rows next to the row of the current cell, instead of over the cells from the cursor on. They show only when the selection is in a single row, and, like Paste, only where the clipboard can be read:
    • A copied table becomes one new row for each of its rows, filled from the first column. When it has more columns than the table, the table gains columns, as with a regular paste. Other content goes in the first cell of a single new row.
    • The new rows are selected afterwards.
    • When merged cells join the row to others, the new rows go above or below that whole block of rows.
  • Sort, below the clipboard section, sorts the rows by the column of the current cell, in Ascending or Descending order. See Sorting rows.
  • Delete row and Delete column, below Sort, remove every row or column the selection touches, even when only some of their cells are selected.
  • Delete table removes the whole table and leaves an empty paragraph in its place. In a table nested inside another, only the inner table is removed.
  • Since v0.107.0, Select, below Delete table, selects the cells of every row (Row) or column (Column) the selection touches, or every cell of the table (Table). Unlike the button, which selects the table as a whole, Table selects its cells, so cell operations such as Merge cells apply to all of them. In a table nested inside another, Table selects only the cells of the inner table.

Right-clicking a cell that is not part of the current selection moves the cursor there first, so the menu always applies to the cell under the pointer.

  • Using the mouse:
    • Click on a cell to focus it.
    • Click the  button at the top or the bottom of a table to insert an empty paragraph near it.
    • Click the  button at the top-left of the table to select it entirely (for easy copy-pasting or cutting) or drag and drop it to relocate the table.
  • Using the keyboard:
    • Use the arrow keys on the keyboard to easily navigate between cells.
    • It's also possible to use Tab to go to the next cell and Shift+Tab to go to the previous cell.
    • Unlike arrow keys, pressing Tab at the end of the table (last row, last column) will create a new row automatically.
    • To select multiple cells, hold Shift while using the arrow keys.
  • Using touch:
    • Since v0.107.0, touching a table outlines the cell with the cursor, or the selected cells, and shows a handle at each corner of the outline.
    • To select multiple cells, drag one of the handles across the table. The cell at the opposite corner stays selected, so the selection grows or shrinks as the finger moves. The note and wide tables scroll when the handle reaches the edge of the screen.

Resizing cells

  • Columns can be resized by hovering the mouse over the border of two adjacent cells and dragging it.
  • To give several columns the same width, select cells across them and choose Distribute columns evenly from the button of the formatting toolbar or from the context menu.
  • By default, the row height is not adjustable using the mouse, but it can be configured from the cell settings (see below).
  • To adjust exactly the width (in pixels or percentages) of a cell, select the  button.

Resizing with touch

Since v0.107.0, touching a table shows a bar at the bottom of the note, above the formatting toolbar on mobile. The bar has a segment for each column of the table, with a divider at the end of each column. Only the divider of the column with the cursor is a handle that resizes; the other dividers only mark where the columns meet, so a swipe across them scrolls instead. When several cells are selected, each column they cover has a handle.

  • To resize a column, place the cursor in one of its cells or tap its segment, then drag its handle. The table grows or shrinks with the column, and scrolls when the handle reaches the edge of the screen. The column snaps to its starting width and to the widths of the columns beside it.
  • To cancel a resize, drag the handle back to where it started, or touch the screen with a second finger.
  • To give a column and the next one the same width, double-tap the handle between them.
  • To select a column, tap its segment. To open the column menu, touch and hold the segment.
  • To scroll a wide table sideways, swipe along the bar.

A wide table scrolls a little past its end, so the handle of its last column stays away from the edge of the screen, where a swipe navigates back.

Wide tables

Since v0.107.0, a table can be wider than the Content width. Such a table scrolls sideways, while the rest of the note keeps its width.

  • A new table is as wide as the content. To make it wider, drag the right border of its last column past the edge of the content. The border snaps to the edge and holds there briefly, so the table is easy to bring back to the width of the content.
  • To set an exact width, enter a percentage above 100% or a width in pixels in the  table properties.
  • A table whose content needs more room than the note, such as a pasted table with many columns, also scrolls instead of stretching the note.
  • Wide tables scroll the same way in read-only notes and on shared pages.
  • When printing or exporting to PDF, a wide table is shrunk to fit the page.

Tables inside other blocks, such as block quotes, admonitions, collapsible blocks, columns or tabs, are limited to the width of their block and do not scroll.

Mobile support

On the Mobile Frontend, a table keeps the width it has on a desktop and scrolls sideways, instead of squeezing its columns into the width of the screen. The full width of a table is the Max content width set in Options → Appearance → Content Width on the mobile device, 1200 pixels by default. For example, a table set to 50% is 600 pixels wide.

To resize columns on mobile, use the bar described in Resizing with touch.

Long tables

Since v0.107.0, the header rows of a table stay visible at the top of the note while you scroll through the rest of the table, and leave with the end of the table. This also works in read-only notes, on shared pages and in wide tables.

To turn rows into header rows, use Set as header in the context menu, or Header row in the button of the formatting toolbar.

To let header rows scroll away with the rest of the table, turn off Options → Text Notes → Features → Use sticky header rows for tables. The setting applies to the current device only, and shared pages keep their sticky header rows.

Inserting new rows and new columns

  • To insert a new column, click on a desired location, then press the  button from the formatting toolbar and select Insert column left or right.
  • To insert a new row, click on a desired location, then press the  button and select Insert row above or below.
    • A quicker alternative to creating a new row while at the end of the table is to press the Tab key.
  • Both operations are also available in the context menu, which inserts as many rows or columns as the selection spans.
  • The menu of the block handle beside a cell, described in Formatting toolbar, also has Insert row above and Insert row below.
  • After an insertion, the caret moves into the new row and stays in its column, or into the new column and stays in its row.

Moving rows and columns

Since v0.106.0, rows and columns can be reordered with the keyboard:

  • Alt+Up and Alt+Down move the rows touched by the selection up or down.
  • Alt+Left and Alt+Right move the columns touched by the selection left or right.

Merged cells are never split by a move. The rows or columns held together by a merged cell travel as one block, and moving toward such a block jumps over it entirely.

When the table has a header row, a header row moved below the header area becomes a regular row, and a regular row moved into the header area becomes a header row. Header columns behave the same way.

Outside of tables, Alt+Left and Alt+Right keep navigating the note history, and Alt+Up and Alt+Down keep moving the current paragraph.

Sorting rows

Since v0.107.0, the rows of a table can be sorted by the values of one column:

  • To sort all the rows, place the cursor in any cell of the column to sort by, then select Sort → Ascending or Descending from the context menu. The same items are in the button of the formatting toolbar.
  • To sort only some of the rows, select their cells in the column to sort by, then sort the same way. Sorting is not available while the selection spans more than one column.

Header rows always stay at the top of the table and are never sorted. A sort can be undone with Ctrl+Z.

How values are compared

Each cell is read as plain text, so formatting does not affect the order. Trilium then detects what kind of value the cell holds:

KindExamplesCompared by
Time15:02, 15:02:38, 3:02 PMThe time of day.
Date2026-09-30, 2026-09-30 15:02, 30 September 2026, Wednesday, 30 September 2026, 2026-09-30T15:02:38+03:00The date and time.
Number12, -3.5, 1,234.56, $ 12.04, 21 RON, 24.5mThe numeric value.
TextAnything else.Alphabetically, ignoring case, with numbers inside the text in numeric order (Item 9 before Item 10). Accents count, so a and á differ.
EmptyAn empty cell, or one holding only spaces.Not compared. Empty cells always go last.

Ascending order puts times first, then dates, numbers and text. Descending order reverses it. Empty cells go last in both directions.

Numbers, dates and times with the same value are ordered by their text, so 5 apples comes before 5 pears. Rows whose cells hold the same text, ignoring case, keep their relative order.

  • Dates are also recognized in the formats of the note's language, such as 30.09.2026 or 30. September 2026 for German, and in the format chosen in Options → Text Notes → Editor → Date/time format for inserting the date and time.
  • A number can start with a currency symbol, such as $, € or £. Whatever follows the number, such as a unit, is ignored, so units are not converted: 1 km sorts before 500 m. A cell that starts with letters, such as RON 21, is text.
  • The decimal separator follows the language of the note: 1.500 is one and a half in English, but one thousand five hundred in German. A comma or period that is not followed by exactly three digits is always read as a decimal separator, so 1,5 is one and a half in either language.
  • The language of the note set in the Status bar via the  icon, or else the default content language. See Content language & Right-to-left support.

Merged cells

Rows joined by a merged cell are kept together and move as one block. The block is sorted by the value in its first row. When the block has more than one cell in the sorted column, the other cells do not affect the order, and a message says so: Some rows were sorted together because merged cells tie them to each other.

When the selection covers only part of such a block, the whole block is sorted.

Merging cells

To merge two or more cells together, simply select them via drag & drop and press the  button from the formatting toolbar.

More options are available by pressing the arrow next to it:

  • Click on a single cell and select Merge cell up/down/right/left to merge with an adjacent cell.
  • Select Merge selected cells to merge the selected cells, the same as pressing the button itself.
  • Select Split cell vertically or horizontally, to split a cell into multiple cells (can also be used to undo a merge).
  • Select Unmerge cells to turn each merged cell in the selection back into the single cells it covers, keeping its content in the top-left one.

Merge selected cells and Unmerge cells are available since v0.107.0. Merging and splitting are also available by right-clicking the selected cells, via the context menu, where Unmerge cells is in the Split cell submenu.

Table properties

Article Image

The table properties can be accessed via the  button and allows for the following adjustments:

  • Border (not the border of the cells, but the outer rim of the table), which includes the style (single, double), color and width.
  • The background color, with none set by default.
  • The width and height of the table in percentage (must end with %) or pixels (must end with px).
  • The alignment of the table.
    • Left or right-aligned, case in which the text will flow next to it.
    • Centered, case in which text will avoid the table, regardless of the table width.

The table will immediately update to reflect the changes, but the Save button must be pressed for the changes to persist.

Cell properties

Article Image

Similarly to table properties, the  button opens a popup which adjusts the styling of one or more cells (based on the user's selection).

The following options can be adjusted:

  • The border style, color and width (same as table properties), but applying to the current cell only.
  • The background color, with none set by default.
  • The width and height of the cell in percentage (must end with %) or pixels (must end with px).
  • The padding (the distance of the text compared to the cell's borders).
  • The alignment of the text, both horizontally (left, centered, right, justified) and vertically (top, middle or bottom).
    • In a centered or right-aligned cell, each item of a bulleted, numbered or to-do list moves together with its bullet, number or checkbox.

The cell will immediately update to reflect the changes, but the Save button must be pressed for the changes to persist.

Border and background colors

The border and background colors of tables and cells adapt to the theme, the same way as text colors do. A color picked from the palette, chosen with the color picker or typed in is shown in a lighter or darker shade that suits the current theme, so borders stay visible and text stays readable on the background. The hue stays the same, and the table keeps the color as it was picked.

Colors applied with older versions of Trilium are shown exactly as they were picked, until the note is next edited.

Older browsers that can't adapt colors show them exactly as they were picked.

Header cells are shaded to suit the current theme. To change their background in every table, set the --text-note-table-header-background variable in a custom theme or in custom app-wide CSS, for example :root { --text-note-table-header-background: #8882; }. A background picked for a cell still takes precedence.

Caption

Press the  button to insert a caption or a text description of the table, which is going to be displayed above the table.

Table borders

By default, tables come with a gray border that is lighter or darker to suit the current theme, so it stays discreet on a dark background.

To change the default border of every table, set the --text-note-table-border-color variable in a custom theme or in custom app-wide CSS, for example :root { --text-note-table-border-color: #555; }. Set it to transparent to hide the borders of all the tables that don't have a border of their own.

To adjust the borders, follow these steps:

  1. Select the table.
  2. In the floating panel, select the Table properties option ().
    1. Look for the Border section at the top of the newly opened panel.
    2. This will control the outer borders of the table.
    3. Select a style for the border. Generally Single is the desirable option.
    4. Select a color for the border.
    5. Select a width for the border, expressed in pixels.
  3. Select all the cells of the table and then press the Cell properties option ().
    1. This will control the inner borders of the table, at cell level.
    2. Note that it's possible to change the borders individually by selecting one or more cells, case in which it will only change the borders that intersect these cells.
    3. Repeat the same steps as from step (2).

Tables with invisible borders

Tables can be set to have invisible borders in order to allow for basic layouts (columns, grids) of text or images without the distraction of their border:

  1. First insert a table with the desired number of columns and rows.
  2. Select the entire table.
  3. In Table properties, set:
    1. Style to Single
    2. Color to transparent
    3. Width to 1px.
  4. In Cell Properties, set the same as on the previous step.

Table indentation

Since v0.104.1, tables can be indented as a block (the whole table moves, rather than just the content of a cell).

  1. Click the  button to select the entire table. Otherwise, the indentation applies only to the current cell's content.
  2. Press Tab to increase the indent, or Shift+Tab to decrease it. Alternatively, use the indentation buttons in the formatting toolbar.

Markdown does not support indented tables, so the indentation is lost when converting to Markdown.

Markdown import/export

Simple tables are exported in GitHub-flavored Markdown format (e.g. a series of | items). If the table is found to be more complex (it contains HTML elements, has custom sizes or images), the table is converted to a HTML one instead.

Generally formatting loss should be minimal when exported to Markdown due to the fallback to HTML formatting.