0 votes
by (220 points)
I can't make a dynamic tables with the tiddlywiki table syntax or regular html, how do I go about doing it? Is there any examples I could learn from?

1 Answer

+1 vote
by (159k points)
selected by
 
Best answer

The following is a very basic example of using the <<for>> macro to loop through an Array of values to create a very simple dynamic table using the related HTML elements.

<<nobr>>
<<set _list to ["one","two","three","four","five"]>>

<table>
<<for _i to 0; _i lt _list.length; _i++>>
	<tr>
		<th>_i</th>
		<td>_list[_i]</td>
	</tr>
<</for>>
</table>
<</nobr>>

... notice the use of the <<nobr>> macro to remove all the invalid line-breaks (br elements) that would of been generated inter-spaced between the HTML table related elements (like tr, th, and td) due to the way I formatted the code. I could of also used Line Continuations instead of the <<nobr>> macro.

...