PDA

View Full Version : Adding table to story?



biomage
December 2nd, 2011, 23:29
I there any way to add a table to a story feature?

Trenloe
December 3rd, 2011, 00:36
You can't add tables directly into the Story entry within FG (as you've found).

The library entry for the formattedtextcontrol details here (https://www.fantasygrounds.com/refdoc/formattedtextcontrol.xcp) mentions:

table - Indicates a table. Tables can not be created or edited, only accessed via modules created outside of FG.
What this means is, that you can use the table tags within a module XML to create tables. A very basic example is:

<text type="formattedtext">
<p>This is my test entry. Can a table be added?</p>
<table>
<tr>
<td>First</td><td>Second</td><td>Third</td>
</tr>
<tr>
<td>1</td><td>2</td><td>3</td>
</tr>
<tr>
<td>4</td><td>5</td><td>6</td>
</tr>
</table>
</text>

Therefore, you can create story entries in a module by manually editing the module XML to add a table.

But, modules essentially have the same structure as the base campaign XML. So, taking this further, you can manually add a table to the campaign db.xml file. Steps to do this:

Create a test story entry in your campaign.
Exit Fantasy Grounds.
Backup your campaign directory - just in case you break your campaign!
Edit db.xml in your campaign directory and search for the story entry you made in step 1.
Manually add the <table> <tr> and <td> tags to create the table you want - do this between the <text type="formattedtext"> and </text> tags.
Check the XML syntax is OK and save db.xml.
Load your campaign in Fantasy Grounds and hopefully your story entry now has a nice table! :-)

Trenloe
December 3rd, 2011, 00:48
P.S. DrZeuss has written a Module Workshop Tool that makes creating Fantasy Grounds XML easier. Details in this post here. (https://www.fantasygrounds.com/forums/showpost.php?p=116940&postcount=3)

biomage
December 3rd, 2011, 01:36
Thanks! This helps a lot.