0 votes
asked 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
answered by (109k 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.

Welcome to Twine Q&A, where you can ask questions and receive answers from other members of the community.

You can also find hints and information on Twine on the official wiki and the old forums archive.

See a spam question? Flag it instead of downvoting. A question flagged enough times will automatically be hidden while moderators review it.
...