HELP: Joining snippets together to form a table

This forum is for all Flare related Tips and Tricks.
Have a tip or trick you use while working in Flare? Share it here.
Post Reply
scopley
Propeller Head
Posts: 11
Joined: Tue Feb 25, 2014 2:17 pm

HELP: Joining snippets together to form a table

Post by scopley »

I have a bunch of snippets that look all like this:
Capture.JPG
They are each individual tables with 7 columns and 1 row.

I would like to be able to insert them one after another and i'm thinking if all the columns were the same width then the column separators should line up and it would look like one big table.

However, even after specifying column widths for all 7 columns when I insert the snippets one after another the column separators do not line up (see below for example). Does anyone know why this would be?
Capture1.JPG
Is there a better way I could be taking all of my individual snippets and combining them to look like one big table?

Here is the code for each snippet. ** I should add that my target output is PDF and I tried defining the column width in inches as well without success. **

<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="5" MadCap:lastHeight="54" MadCap:lastWidth="864">
<head>
</head>
<body>
<table style="width: 100%;">
<col style="width: 200px;" />
<col style="width: 50px;" />
<col style="width: 50px;" />
<col style="width: 300px;" />
<col style="width: 75px;" />
<col style="width: 90px;" />
<col style="width: 200px;" />
<tbody>
<tr>
<td class="Parameters">Adaptive_Gain</td>
<td class="Parameters">REAL</td>
<td class="Parameters">Float</td>
<td class="Parameters">Surge Adapter - Gain multiplier that determines how much SCL moves to the right in response to rate of change of OP towards SCL</td>
<td class="Parameters">Read/Write</td>
<td class="Parameters"> </td>
<td class="Parameters"> </td>
</tr>
</tbody>
</table>
</body>
</html>
You do not have the required permissions to view the files attached to this post.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: HELP: Joining snippets together to form a table

Post by LTinker68 »

It happens that way because each row is its own table, so each table is following its internal rules for the content contained within that table. Tables only care about their content, not content of other tables in the same topic. If you need to keep the tables separate, then you need to specify the width for every column (except perhaps the last one) in every table to be the same. For example, the first column in each table is 100px or .5 inch, whatever. That's still not a guarantee that they'll line up, because a table will try to allow continuous text (e.g., a really long word) to remain as one line, unless you set the hyphenation in the table cell to break words.

Have you looked at snippet conditions? I haven't used them myself (never had a need), but from what I've read on the forums, it might provide you with what you need. It's not quite the same as regular conditions, which is what always threw me off.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: HELP: Joining snippets together to form a table

Post by Msquared »

What happens if you take the style="width: 100%;" bit out of

<table style="width: 100%;">

?

I wonder if you have confused Flare by specifying column widths that add up to less than the 100% of the available table width(which, for a print target will be defined by your page layout width and the margin settings)? So when Flare tries to obey that bit, it finds it has more space to fill than specified by the column widths, so just allocates the extra space as seems best according to the text in each cell of each table?

In my experience, if I've (usually inadvertently) specified a specific column width, Flare honours that, even if the text wraps in a silly place.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: HELP: Joining snippets together to form a table

Post by LTinker68 »

Msquared wrote:What happens if you take the style="width: 100%;" bit out ...
The problem would still exist. If the columns don't have a defined width, then they'll take as much space as needed to show the content in that cell. If there is a convenient place to word wrap the content and another cell in the table needs more space to display its contents, then the first cell will word wrap its contents at the best location(s). Since the content in each cell varies from table to table, the column widths won't line up from table to table, unless each column in each table is set to a defined width, and even then it might not work if content in one cell doesn't have a good spot to word wrap.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: HELP: Joining snippets together to form a table

Post by Msquared »

But in this case, the column do have a defined width . . . Or am I missing something?
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Paul Griffiths
Sr. Propeller Head
Posts: 261
Joined: Wed Apr 18, 2007 2:25 am
Location: Nottingham, UK

Re: HELP: Joining snippets together to form a table

Post by Paul Griffiths »

Try using the table-layout property, set to fixed.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: HELP: Joining snippets together to form a table

Post by LTinker68 »

Msquared wrote:But in this case, the column do have a defined width . . . Or am I missing something?
Oh, sorry, missed that you were referring to the original code, which had 100% table width and every column defined.

Yes, you never want to specify a table width and define the width of every column. That produces a probably conflict, because the table is set to 100% but the column widths added together may or may not match 100%. So if you define every column's width, then remove the 100% table width definition.

But as I stated before, it may still not completely honor the widths, unless you enable the option to force a word break in the cell.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply