Table

The table view displays information in a grid, where the rows are individual notes and the columns are Promoted Attributes. In addition, values are editable.
How it works
The tabular structure is represented as such:
- Each child note is a row in the table.
- If child rows also have children, they will be displayed under an expander (nested notes).
- Each column is a promoted attribute that is defined on the Collection note.
- Actually, both promoted and unpromoted attributes are supported, but it's a requirement to use a label/relation definition.
- The promoted attributes are usually defined as inheritable in order to show up in the child notes, but it's not a requirement.
- If there are multiple attribute definitions with the same
name, only one will be displayed. - If an attribute definition has multiple values, they will all be grouped under a single column, with chips indicating individual values.
There are also a few predefined columns:
- The current item number, identified by the
#symbol.- This simply counts the note and is affected by sorting.
- Note ID, representing the unique ID used internally by Trilium
- The title of the note.
- Created and Modified, the date and time the note was created and last modified. These columns are hidden by default and can't be edited; show them from the column context menu and click their header to sort by them.
Interaction
Creating a new table
Right click on an existing note in the Note Tree and select Insert child note → Collection → Table.
Adding columns
Each column is a promoted or unpromoted attribute that is defined on the Collection note.
To create a new column, either:
- Press Add new column at the bottom of the table.
- Right click on an existing column and select Add column to the left/right.
- Right click on the empty space of the column header and select Label or Relation in the New column section.
Adding new rows
Each row is actually a note that is a child of the Collection note.
To create a new note, either:
- Press Add new row at the bottom of the table.
- Right click on an existing row and select Insert row above, Insert child note or Insert row below.
By default it will try to edit the title of the newly created note.
Alternatively, the note can be created from the Note Tree or scripting.
Context menu
There are multiple menus:
- Right clicking on a column, allows:
- Sorting by the selected column and resetting the sort.
- Hiding the selected column or adjusting the visibility of every column.
- Adding new columns to the left or the right of the column.
- Editing the current column.
- Deleting the current column.
- Right clicking on the space to the right of the columns, allows:
- Adjusting the visibility of every column.
- Adding new columns.
- Right clicking on a row, allows:
- Opening the corresponding note of the row in a new tab, split, window or quick editing it.
- Inserting a new note above or below the selected row. These options are only enabled if the table is not sorted.
- Inserting a new child note for the selected row.
- Deleting the row.
Opening notes
Hovering over a row shows an Open button at the end of its title, which opens the note in quick edit. On a touch screen, the button is always visible.
Clicking the title itself renames the note instead (see below). To open the note elsewhere:
- Ctrl+click or middle click the title to open the note in a new tab.
- Shift+click the title to open it in a new window.
- Right click the row to open the note in a new tab, split or window, or in quick edit.
Editing data
Simply click on a cell within a row to change its value. The change will not only reflect in the table, but also as an attribute of the corresponding note.
- The editing will respect the type of the promoted attribute, by presenting a normal text box, a number selector or a date selector for example.
- A boolean column shows a checkbox, which is checked or unchecked with a single click. A note without the label shows an unchecked box.
- It also possible to change the title of a note by clicking it.
- Editing relations is also possible
- Simply click on a relation and it will become editable. Enter the text to look for a note and click on it.
- To remove a relation, remove the title of the note from the text box and click outside the cell.
Editing columns
It is possible to edit a column by right clicking it and selecting Edit column… This will basically change the label/relation definition at the collection level.
Turn on Multiple values to let each note hold several values in that column. The cell then shows them as chips (see Multiple values in Promoted Attributes). The same toggle is available when adding a column.
If the Name field of a column is changed, this will trigger a batch operation in which the corresponding label/relation will be renamed in all the children.
Read-only tables
On a read-only table, the cells can't be edited and the rows can't be dragged. Clicking a note's title opens it in quick edit, so there's no Open button. The New row and New column buttons are hidden, and the context menus offer only what leaves the notes as they are: sorting and hiding columns, and opening the notes. Columns can still be resized and reordered, but the layout isn't saved. The Table properties dialog isn't available.
Working with the data
Sorting by column
By default, the order of the notes matches the order in the Note Tree. However, it is possible to sort the data by the values of a column:
- To do so, simply click on a column.
- To switch between ascending or descending sort, simply click again on the same column. The arrow next to the column will indicate the direction of the sort. On a column that isn't sorted, the arrow appears only while hovering over its header.
- To disable sorting and fall back to the original order, right click any column on the header and select Clear sorting.
Reordering and hiding columns
- Columns can be reordered by dragging the header of the columns.
- Columns can be hidden or shown by right clicking on a column and clicking the item corresponding to the column.
Reordering rows
Notes can be dragged around to change their order. To do so, move the mouse over the three vertical dots near the number row and drag the mouse to the desired position.
This will also change the order of the note in the Note Tree.
Reordering does have some limitations:
- If the parent note has
#sorted, reordering will be disabled. - If using nested tables, then reordering will also be disabled.
- Currently, it's possible to reorder notes even if column sorting is used, but the result might be inconsistent.
Nested trees
If the child notes of the collection also have their own child notes, then they will be displayed in a hierarchy.
Next to the title of each element there will be a button to expand or collapse. By default, all items are expanded.
Since nesting is not always desirable, it is possible to limit the nesting to a certain number of levels or even disable it completely. To do so, go to Note menu → Table properties and set Maximum nesting depth (under the Included notes section), or set the #maxNestingDepth label of the collection:
0disables nesting, showing only the children of the collection.1also shows their children,2the level below that, and so on.- Removing the label shows every level again.
Limitations:
- While in this mode, it's not possible to reorder notes.
Limitations
- There is no support to filter the rows by a certain criteria. Consider using the table view in search for that use case; for example,
note.dateCreated >= TODAY-7lists the notes created in the last week.
Use in search
The table view can be used in a Saved Search by adding the #viewType=table attribute.
Unlike when used in a Collection, saved searches are not limited to the sub-hierarchy of a note and allows for advanced queries thanks to the power of the Search.
However, there are also some limitations:
- It's not possible to reorder notes.
- It's not possible to add a new row.
Columns are supported, by being defined as Promoted Attributes to the Saved Search note.
Editing is also supported.