Snippet within TD makes table wider than page

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
iWriteThereforeIam
Jr. Propeller Head
Posts: 6
Joined: Thu Jan 29, 2015 11:56 am

Snippet within TD makes table wider than page

Post by iWriteThereforeIam »

I have a simple table and a snippet block within a cell in the second column (see below). When the output target is set to PDF, the first column is 1-character wide, and the second column is wider than the page size (content truncated extended at margin). The snippet contains a bulleted list (see below). Any ideas what might be going wrong?

Code: Select all

MY TABLE

<table>
<tr>
<td>Row1</td>
<td><MadCap:snippetBlock src="Resources/Snippets/Find User.flsnp" /></td>
</tr>
</table>
I've tried:

1.) Switching between snippetblock and snippettext... no dice.
2.) Using CSS to set a style="max-size:6in" to the snippet, <div> around it, table cell, all my usual bag of css tricks.
3.) Using another .CSS file upon output

I'm totally stumped and pulling my hair out here lol !!!! BTW I'm using flare 11.1.0, if that at all helps.

Code: Select all

 
MY SNIPPET

<body>
        <ul>
            <li>Click the <b>Find </b><img src="../Images/find-user.png" /> button to open the Select User(s) window.</li>
         ...
        </ul>
 </body>
tyip
Jr. Propeller Head
Posts: 9
Joined: Wed Mar 12, 2014 11:59 am
Location: Canada

Re: Snippet within TD makes table wider than page

Post by tyip »

In the snippet, try deleting the <ul> tags and go straight from <body> to <li>.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Snippet within TD makes table wider than page

Post by ChoccieMuffin »

tyip wrote:In the snippet, try deleting the <ul> tags and go straight from <body> to <li>.
Surely that would be "illegal" html?
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Snippet within TD makes table wider than page

Post by Nita Beck »

I agree with Choccie that removing the enclosing <ul> is malformed HTML and is unlikely to correct the problem.

What is the width of the entire table? Do you have it set to auto or 100%? My hunch is auto. Does setting the table's width to 100% correct the problem?
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
tyip
Jr. Propeller Head
Posts: 9
Joined: Wed Mar 12, 2014 11:59 am
Location: Canada

Re: Snippet within TD makes table wider than page

Post by tyip »

It's not "illegal" html when it's a snippet within a list, i.e., the <ul> or <ol> tags are outside the snippet. Look at the whole topic in html with the snippet's html inside it and see if the html is malformed. In any case, it's easy enough to try and reject if it doesn't work.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Snippet within TD makes table wider than page

Post by Nita Beck »

So let's make sure we understand your solution. (I'm not trying to pick on you; rather, I'm seeking to add clarification.)

The OP has a list with several list items within a td in a table. Your suggestion is to remove the <ul> tag from within the snippet, so there will be just multiple <li> blocks in the snippet. The OP now inserts that snippet into the <td>. So where will the wrapping <ul> come from? When Flare generates the output topic, it will replace the snippetBlock with the contents of the snippet, so there will be a <td> tag within which there are several <li> blocks. That's malformed code.

Are you suggesting that the OP put the <ul> within the <td> and then there insert the snippetBlock? That might work. Would have to test it out. My point is that your original suggestion didn't say anything about where the <ul> would come from, just that it wouldn't be within the snippet. I interpreted your suggestion as meaning that there'd be no <ul> anywhere, and hence we'd have malformed code.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
tyip
Jr. Propeller Head
Posts: 9
Joined: Wed Mar 12, 2014 11:59 am
Location: Canada

Re: Snippet within TD makes table wider than page

Post by tyip »

Hi Nita, glad to meet you online. Your reputation precedes you.

Rereading the original post, you're right in that if the table cell is a snippet with list items and nothing else, then my suggestion would not work. There has to be a <ul> or <ol> tag inside or outside the snippet. I should have been clearer about that.

If the table cell already contains a list (with the <ul> or <ol> tag), then adding a snippet to the existing list (without the <ul> or <ol> tag) would just continue the existing list.

In the OP's use case, he can try putting the <ul> tag within the <td> tag and then insert the snippet that has no <ul> tag.

In my use case, say I have 3 steps that are often reused. I put those 3 steps in a snippet without the <ol> tag. In one list, those can be steps 4,5,6. In anther list, those steps can be steps 7,8,9. In this case, the snippet with the line items do not have the <ol> tag.

I do HTML5 and PDF output and Flare formats the numbering and style correctly. I was very impressed with Flare once I found out (by trial and error) that I can put list items in a snippet and insert them in any list, in the beginning, middle, or end. Note that the numbering and indentation might look weird in the Flare window but the output is formatted correctly.

The example below is not inside a table but should work the same in a table cell.
Example of the topic:

Code: Select all

<ol>
   <li>In the server, open a command prompt.</li>
   <MadCap:snippetBlock src="../Resources/Snippets/steps_to_replace_files.flsnp" />
   <MadCap:snippetBlock src="../Resources/Snippets/steps_to restart_server.flsnp" />
   <li>Check that the server started with the new files.</li>
</ol>
Example of the snippet:

Code: Select all

<body>
   <li>Create a new common location and copy the file there.</li>
   <li>Open the file.</li>
   ...
   <li>Save and close the file.</li>
</body>
Tony
iWriteThereforeIam
Jr. Propeller Head
Posts: 6
Joined: Thu Jan 29, 2015 11:56 am

Re: Snippet within TD makes table wider than page

Post by iWriteThereforeIam »

Thanks for the replies. I ended up just selecting the snippet block and then selecting "Convert to text" in each of half a dozen topics. Not what I had really wanted to do in this situation, but it worked, the outputted .PDF's looked excellent, and I met my deadline lol. There is clearly something up with the snippet being within a table cell. Once the snippet is taken out of the equation (by rendering it to text) the same exact information renders correctly within the .PDF output. Same coding, no changes, but "Convert to text".

I revisted the same help topic with the same snippet in a table to try out the suggestions above, and no dice. I added the <ul>'s into the table cell, and then the snippet block between them (and removing the <ul>'s from the snippet itself). The table itself is currently auto-sized. I tried hard coding the size to a fixed number of pixels, and that made no difference. I tried applying other .CSS styles to the output, and that made no difference. So, I am convinced it is not a CSS issue.

Table cells seem to be a Madcap Flare's Achilles heel. Add two images within a single table cell and madcap flare freaks out (GUI shows a big red X). The only way I can get two images within the same table cell is if I hand-code a <span> around subsequent images.

Code: Select all

Click one of these icons: <td><img src="save.png">, <span><image src="saveas.png"></span>, or <span><image src="saveandexit.png"></span></td> 
Last edited by iWriteThereforeIam on Mon Nov 16, 2015 8:45 am, edited 1 time in total.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Snippet within TD makes table wider than page

Post by Nita Beck »

Nita Beck wrote:Does setting the table's width to 100% correct the problem?
Did you try my suggestion above to set the table's width to 100%, not to auto and not to some hardcoded number of pixels? I'm not guaranteeing this'll work, but have you tried that too?
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
iWriteThereforeIam
Jr. Propeller Head
Posts: 6
Joined: Thu Jan 29, 2015 11:56 am

Re: Snippet within TD makes table wider than page

Post by iWriteThereforeIam »

Yes, Nita, I did. Didn't work.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Snippet within TD makes table wider than page

Post by Nita Beck »

:( I'm out of ideas, then. Time to kick it to MadCap?
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
kkelleher
Sr. Propeller Head
Posts: 163
Joined: Wed Nov 12, 2008 12:42 pm

Re: Snippet within TD makes table wider than page

Post by kkelleher »

iWriteThereforeIam wrote:Add two images within a single table cell and madcap flare freaks out (GUI shows a big red X).
Just my $0.02 -- I'm not having this problem in 11.1.0. I can drag an image from the Contents pane into my topic and drop it into a table cell that already have an image, and Flare is fine.
Table cells seem to be a Madcap Flare's Achilles heel.
Seconded. We've had some weird/hard-to-troubleshoot problems with tables in general.

Thanks,

Kristen
Kristen Kelleher
Director of Tech Pubs, TIBCO Jaspersoft
andy
Jr. Propeller Head
Posts: 1
Joined: Wed Aug 31, 2016 7:39 pm

Re: Snippet within TD makes table wider than page

Post by andy »

iWriteThereforeIam wrote:Add two images within a single table cell and madcap flare freaks out (GUI shows a big red X). The only way I can get two images within the same table cell is if I hand-code a <span> around subsequent images.
Thank you, thank you, thank you. I was having this same exact problem, and this little offhand remark saved my deadline. In the PDF, I had 2 messed-up tables with the narrow 1px first column and then off-the-page 2nd column (which of course made them tall and spread over several pages). In the GUI, the tables were not displaying normally (missing many internal rules), and when I clicked in them, Flare gave an error, showed the red big red X or box at the top, but did not crash.

I had several tables full of inline images, bullets, index markers, all rendering except those two, so I figured there was something that Flare was choking on, but I couldn't find it. I suspected it was the index markers, and tried moving them out of the table. I would've searched a long time, and probably removed all inline images, if I hadn't seen your comment about the TWO images in a single cell. Sure enough, both bad tables had that and removing the second image in each cell fixed the problem.

I tried your workaround of putting the second image in a span, and it did prevent the crashing, but then Flare dropped the baseline on other spans in the same cell (appearing below the text baseline in the GUI and PDF). So I had to remove the second image and reword the text to accommodate that.

FWIW, I am on Flare 11.1.2 - 12/11/2015 5:29 PM on Windows 10 home, latest update, but I suspect it has to do with the underlying .NET framework (still, I find that unacceptable in a commercial product). It really seems to be related to the OS environment, because others on my team with the same Flare version have previously built this same PDF with the two images per cell appearing correctly. Maddening to say the least.

So thank you again,

Andy
kkelleher
Sr. Propeller Head
Posts: 163
Joined: Wed Nov 12, 2008 12:42 pm

Re: Snippet within TD makes table wider than page

Post by kkelleher »

Thank for making the deadline, Andy. I agree that 2 images in a cell should work, hands down. I'm also always reminded of our own JR product when we can't suss Madcap.
Kristen Kelleher
Director of Tech Pubs, TIBCO Jaspersoft
subquark
Propeller Head
Posts: 21
Joined: Mon Mar 18, 2013 1:11 pm
Location: Portsmouth, NH
Contact:

Re: Snippet within TD makes table wider than page

Post by subquark »

Two cents on the LI element. It's not illegal, per se, to not use an OL or UL to wrap list items, it simply means you're leaving it to the browser to interpret the LI tag. This is unpredictable (and various browsers render these slightly differently anyway, much to our chagrin!). =D

In addition to OL and UL tags, a list item can be wrapped in a <MENU> tag like this:

<menu>
<li>
<button type="button" onclick="addblah()">New Blah</button>
<button type="button" onclick="addblahblahs()">Add Many Blahs</button>
</li>
<li>
<button type="button" onclick="editblah()">Change Blah</button>
<button type="button" onclick="deleteblah()">Delete Blah</button>
</li>
<li>
<a href="http://subQuark.com">Woohoo - Games</button>
<a href="http://some-other-link.com">Another Link</button>
</li>
... more list items as needed ...
</menu>
Post Reply