Word ignores margin-top/bottom for tables

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
JupiterJones
Propeller Head
Posts: 42
Joined: Fri May 23, 2008 2:09 am

Word ignores margin-top/bottom for tables

Post by JupiterJones »

Is it somehow possible to define a top and bottom margin for tables (Word target)? The margin-top/margin-bottom properties of the table tag seem to be ignored by Word. Is there a work-around? Without modifying the paragraphs before and after... :wink:

JJ
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Word ignores margin-top/bottom for tables

Post by LTinker68 »

If you put the table inside a custom <p> or <div> tag and set the margin-top and margin-bottom values on the <p> or <div> then I think it will work.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
JupiterJones
Propeller Head
Posts: 42
Joined: Fri May 23, 2008 2:09 am

Re: Word ignores margin-top/bottom for tables

Post by JupiterJones »

Unfortunately not. Divs are ignored by Word, and the surrounding p class also disappears in Word...
Any ideas?

JJ
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Word ignores margin-top/bottom for tables

Post by LTinker68 »

Finally figured out a way to get the effect, but it's not that elegant. The only way I could get it to work was to create two new custom <p> classes, one I called tblBefore and the other called tblAfter. tblBefore had a margin-bottom set to 50pt and tblAfter had a margin-top set to 50pt. So in simplistic form, the page code was:

Code: Select all

<p class="tblBefore">Blank space or paragraph of text.</p>
<table>
...
</table>
<p class="tblAfter">Blank space or paragraph of text.</p>
That worked in Word output.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Word ignores margin-top/bottom for tables

Post by doc_guy »

I've been using something similar to lisa's suggestion for a while, and it works. Thankfully this appears to work properly in Blaze(/Flare4) when your target is PDF. (Meaning, that in Blaze you don't need the extra code when your target is PDF. It just works like you expect. Since it works in Blaze, you can pretty much bank on it working in Flare4).
Paul Pehrson
My Blog

Image
Post Reply