PDA

View Full Version : Text formatting - table columns help



brochr
October 9th, 2013, 08:01
Hi Folks

I have what I hope is a simple question but I can't find an answer in the FG guide or in the forums. When creating stories I would like to insert a table with two or more columns. The "table" text format creates one column and I can't see a way to add extra columns. I can add rows easily enough.

I am doing this so I can insert personal notes on the DC needed for certain tasks - other suggestions on how to do this will be welcome of course. we are using 3.5 OGL

All the best

Christopher

Trenloe
October 9th, 2013, 16:14
In the current 2.9.4 ruleset tables within story entries need to be manually added in the FG database XML outside of Fantasy Grounds. It's a bit of a pain, I know. But, in 3.0 (currently in alpha test) you can add them directly into the story entry.

To create them currently:

Install a good XML editor on your PC. I recommend the free Notepad++: https://notepad-plus-plus.org/
Have your story entry where you want to add a table already created in your Fantasy Grounds campaign.
Exit Fantasy Grounds - do not have your campaign running while you are editing Fantasy Grounds campaign database XML.
Using Windows Explorer, go to the directory of the campaign you were just working on: <FG App Data Directory>\campaigns\<your campaign name>
Make a backup copy of the db.xml file (just in case something goes wrong later).
Open the db.xml file in Notepad++ (or your chosen text/XML editor).
Find the <encounter> entry that is related to your story entry you created in step 2 - I've shown an example screenshot below. This is a little confusing, <encounter> is actually the XML tag for the Story area within the FG database db.xml file, not for the 3.5e encounter records, which are stored with the <battle> tag. To find the <encounter> tag section you can use the search facility in Notepad++ or manually close the other entries by clicking on the small "-" button to the left of the text.
Within the <encounter> section there will be a lot of story entries - starting with an ID number of <id-00001>. Find the one that you want to add the table to.
Within the <text type="formattedtext"> tags, enter your table using the <table>, <tr> and <td> tags - this is similar to HTML table tags. Note: FG does not support all HTML table tags, just the <table>, <tr>, <td> and colspan tags - more info here: https://www.fantasygrounds.com/forums/showthread.php?14323-What-HTML-Attributes-are-available-in-FG2 A useful tool to create this XML is found in this thread: https://www.fantasygrounds.com/forums/showthread.php?15656-Copy-and-paste-module-text The 4E Module Workshop application mentioned is available from Dr Zeuss's website - click on the graphic link in the signature of his post.
After editing the XML, check the syntax is correct with: Plugins -> XML Tools -> Check Syntax Now.
Save the db.xml file.
Open Fantasy Grounds and your table should be in the story entry.


Note: FG 2.9.4 does note support borders on the table - you will not see any lines. FG 3.0 will have lines in the table.

Here is the Fantasy Grounds campaign db.xml file after adding in the table code (step 9):

https://dl.dropboxusercontent.com/u/39085830/Screenshots/XML%20Table.jpg

And here is the result in Fantasy Grounds:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/XML%20Table%20in%20FG.jpg

Hope this helps you get your tables into your story entries and is not too technical... If you have any questions just ask. :)

brochr
October 10th, 2013, 03:31
Thanks Trenloe

Very clear instructions indeed. I saved the html as a snippet and can now drops it in where needed which speeds things up slightly. I am looking forward to seeing how it works in 3.0. Here is my sample:

5231

All the best :)

C

Trenloe
October 10th, 2013, 03:49
Glad the instructions worked for you. :-)

In addition, there is another tag/variable that is supported in FG tables: colspan. Basically, this allows a column to span more than one column unit, so you can have some control over how wide the columns are of the table.

Useage: <td colspan="X"> Where X is a number. If X is 2, then the table data in the <td colspan="2"> ... </td> tags will span 2 column units.

So, if you wanted your Spellcraft table to have a smaller column for the DC and a larger one for Result, try this:

<table>
<tr>
<th>DC</th>
<th colspan="2">Result</th>
</tr>
<tr>
<td>21</td>
<td colspan="2">Magic Wand [Level 6 Conjuration, Trioband's Baleful Teleport]</td>
</tr>
<tr>
<td>19</td>
<td colspan="2">Magic Wand 9 [Level 4 Enhancement, Hold Person]</td>
</tr>
</table>
This makes the Result column twice as wide as the DC column - essentially making 3 column units for the whole table with the DC column using 1 of the 3 units and the Result column using 2 of the 3 units.

brochr
October 23rd, 2013, 04:06
Hi Trenloe

It took me a while to get back to this but I wanted to acknowledge your help - first class indeed!

Thanks

C

Trenloe
October 23rd, 2013, 04:08
It took me a while to get back to this but I wanted to acknowledge your help - first class indeed!
No worries at all - thanks is welcome at any time! :)