Question about table syntax

Hopefully I’m striking the right tone here, :thinking: , but I am more curious than anything else.

Is TiddlyWiki table syntax is based off of another markup language?

I only ask this because it seems like there are some tradeoffs with the current syntax, particularly since white space is used for individual cell alignment.

Since the TW syntax for tables probably exists since 2004 or so it’s very likely that other markup languages where inspired by TWs markup and not the other way around.

The TW5 syntax incorporated “code-blocks” and “inline-code” from the Markdown syntax. … But the basic table syntax did not change between TWc and TW5. I think TW5 has more formatting options.

You need to be a bit more specific, what you mean by “tradeoffs”.

As far as I know, there is no other table markup that allows more customisation options than the TW table wikitext.

I had seen something similar before, if not WikiPedias table mark up which is different in ways I don’t like.

  • The current tiddlywiki method is great for quickly entering/typing a small table, documentation Tables in WikiText.
  • The wikitext table is also better than many when wanting to align and merge cells

However when wanting your table to have rows and/or columns that respond to tiddlywiki data, the result of list widgets etc… I find using the full HTML table syntax easier to use for complex data driven tables.

For example try on tiddlywiki.com

<table>
 <thead>
   <tr>
     <th>Tag</th>
     <th>Count</th>
   </tr>
 </thead>
 <tbody>
 <$list filter="[tags[]limit[10]]">
   <tr>
     <td><<tag>></td>
     <td><$text text={{{ [tag<currentTiddler>count[]] }}}/></td>
   </tr>
  </$list>
 </tbody>
</table>
  • Although someone may know a trick to doing this with the markup?

If you install the Internals plugin as as on tiddlywiki.com you can see the wiki tables converted to HTML

  • This can assit in rapid development of and learing HTML table for use in TiddlyWiki (See evenRow/oddRow)

eg;

|myclass anotherClass|k
|This is a caption |c
|Cell1 |Cell2 |
|Cell3 |Cell3 |
|Header|Header|h
|Footer|Footer|f

Gives

<table class="myclass anotherClass"><caption>This is a caption </caption>
<tbody>
<tr class="evenRow">
   <td align="left">Cell1</td><td align="left">Cell2</td>
</tr>
<tr class="oddRow">
   <td align="left">Cell3</td><td align="left">Cell3</td>
</tr>
</tbody>
<thead><tr class="evenRow"><td>Header</td><td>Header</td></tr></thead>
<tfoot><tr class="oddRow"><td>Footer</td><td>Footer</td></tr></tfoot>
</table>
  • Spacesa and new lines added for readability.

See my post in this discussion Some TiddlyWiki CSS questions - #7 by TW_Tones I have even got ChatGPT to write tiddlywiki wikitext tables, I had to tell it to replace || with |.

It gave me this;

|! First Name |! Last Name |! Age |! Country |
| John       | Doe        | 30   | USA     |
| Jane       | Doe        | 28   | Canada  |
| Bob        | Smith      | 45   | Australia |
| Alice      | Johnson    | 33   | UK      |

Now I just need to find how to;

  • Get it to use my test data or a csv input
  • Or in the HTML version use a list widget to itterate the rows, and another for the columns.
1 Like