Simple tables using Katex arrays

Here’s a way to create simple tables in Dynalist using the Katex ‘array’ function.

For example, this text:
image

Will display as this table:

image

By entering CTRL-SHIFT-ENTER to start a new line when you enter the text in Dynalist, the individual table rows remain as separate lines in Dynalist, so they are quite easy to maintain.

The table text is also fully searchable.

The ‘{ccc}’ on the first line of the Katex specification indicates there are three columns, and the text is centred in each. You can use ‘l’ for left justified or ‘r’ for right justified text. You can also add either ‘:’ or ‘|’ between the characters to add dotted or full vertical lines. You can add extra lines between the rows by adding ‘\hline’ or ‘\hdashline’.

Spaces in the text to display are ignored, but you can use ‘~’ instead as I have done in the example above. You can also enter text with spaces by using this syntax: ‘\text{Text with spaces}’.

Here’s another example with 4 columns. Enter this:
image

To see this:
image

If you add ‘\left[’ after the initial ‘$$’ and ‘\right]’ just before the final ‘$$’ then braces will be added to both sides of the table, like this:

image

I think this is a relatively simple way to add basic table functionality to Dynalist that I have not seen mentioned before. Enjoy!

Cheers,

Stephen

9 Likes

This is cool, thanks!

Wow, this is great! Thanks for posting it.

I almost thought we could do Kanban-like things with this, but it’s a bit clunky for that :slight_smile:

Hey I found a nice use case for this - daily habits / routines (it has always annoyed me with dynalist how much vertical space these take up):

$$ \begin{array}{cccccccc}
Daily & Mo & Tu & We & Th & Fr & Sa & Su \ \hline
~Ex~ & [x] & [] & [] & [x] & [] & [] & []\
~Md~ & [] & [] & [] & [] & [] & [] & [] \
\end {array} $$

becomes:

image

Edit: Nicer formatting:

image

2 Likes

@Stephen_Dewitt
Thanks for the inspiration. I made a correction to the code. Maybe it is the updates but it does not work with single backslashes.

$$ \begin{array}{cccccccc}
Daily & Mo & Tu & We & Th & Fr & Sa & Su \ \hline
~Ex~ & [x] & [] & [] & [x] & [] & [] & []\
~Md~ & [] & [] & [] & [] & [] & [] & [] \
\end {array} $$

1 Like

Wow, that’s a great trick! Thanks for posting.

1 Like

This does not work. If I just paste in Dynalist, I get a lot of bullets, when clearly it should be one. If I edit it all to a single line, the markdown isn’t recognized and I get nothing. I know it’s possible, but can someone post a formatted entry that I can actually paste into Dynalist?

Hi,
Somehow the comment box removes the extra backslashes but I think I found a workaround. Correct version is as follows:

$$ \begin{array}{cccccccc}
Daily & Mo & Tu & We & Th & Fr & Sa & Su \\ \hline
~Ex~ & [x] & [] & [] & [x] & [] & [] & []\\
~Md~ & [] & [] & [] & [] & [] & [] & [] \\
\end {array} $$

It’s still broken into multiple lines, but I was able to adjust.

$$ \begin{array}{cccccccc} Daily & Mo & Tu & We & Th & Fr & Sa & Su \\ \hline ~Ex~ & [x] & [] & [] & [x] & [] & [] & []\\ ~Md~ & [] & [] & [] & [] & [] & [] & [] \\ \end {array} $$

This can be pasted into Dynalist. Your version can be recreated by using Ctrl-Shift-Enter to break up the lines at spots, but can’t be pasted from here to there and create a valid table entry.

Unless in a note. That works, but only if you have multi-line display of notes turned on.