That doesn’t work however. What’s the right way to generate a table that way? I could resort to a full-out HTML table, but hoping it wouldn’t be necessary.
I wonder if someone who understands the core implementation can explain in layman’s terms why this is so. I discovered the same thing (and rediscovered it several more times when I temporarily forgot it!) But plenty of wikitext is properly expanded inside <$list> ... </$list>. What are the technical reasons this doesn’t work with table rows?
I think the issue is you need a blank line inside the list so it is treated in block mode, but the wikitext tables need no gap gaps or the table breaks.
Somewhere along the line I gave up on this and use html tables except for very simple tables. As soon as I use lists within the tables I go strait to html tables
Is this a valid approach? I would need to experiment but I did this many times in the past and gave up. Madness is doing the same thing over and over thinking you will get different results.
The code that implements the wikitext markup for tables expects one contiguous chunk of text defining the entire table. However, when using the list widget, each iteration of the widget is processed separately.
But in tiddlywiki another way to gather things into a whole is via transclusion,
place some tiddlywiki script in a tiddler and transclude it eg {{$:/invoicing/accounts-table}} or to have it apply to the current tiddler {{||$:/invoicing/accounts-table}}
and use fields in the current tiddler to drive the table, or wrap the transclusion in a let widget to set variables that apply inside the transcluded tiddler.
@TW_Tones , what I meant was a concept similar to eval in many languages. You pass it a string that conforms to the syntax of that language and the function executes it.
In the context of tiddly wiki, I’m trying to avoid dealing with an HTML table entirely. Instead, I’m trying to see if there’s a way to accumulate a string containing the definition of a table and then have a macro/widget render the resulting string.
The string would start out by containing just |!col1| and then a loop would add a row in each iteration so that at the end the total “wiki” string would be something like:
That’s a necessary line break before <<currentTiddler>>, by the way: without it, the parser will revert to inline mode and the wikitext table will collapse.
Yes, I am sure you can do as you ask, the specifics need to be addressed, the two trick you need to establish is as far as I see;
Build a variable, possibly through the append operator, but you need to insert line breaks;
Wikify the resulting variable to get the end result
However to me this is a strong case for returning to the “what you want” and choosing the best way to impement it, not choosing a way and trying to make it work. I would reconsider using tiddlywiki table markup because it is somewhat fragile from expierence.
I belive there are features in TW5.3.x that will help do this kind of thing much more easily, but it remains to be fully explored.