Avoiding table cell breaks with table stylesheets?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Ingrid
Jr. Propeller Head
Posts: 2
Joined: Tue Oct 12, 2010 8:00 am
Location: Paris, France

Avoiding table cell breaks with table stylesheets?

Post by Ingrid »

How to avoid cells breaking across pages in MS Word while using table styles?

I've set the following in my topic stylesheet (Stylesheets\Styles.css) and it works well with MS Word as long as I don't assign a table style to the table:

Code: Select all

tr
{
	page-break-inside: avoid;
	orphans: 2;
	widows: 2;
}
I'm using MadCap version 6.1.

The problem is, as soon as I assign a table style (defined in a specific CSS in the \TableStyles folder) to my table, the property doesn't work anymore in MS Word output.

I've tried many tricks, based on previous posts in this forum, but it still doesn't work:
- applying the "page-break-inside: avoid" to all styles in my table stylesheet,
- adding styles to my topic stylesheet (like td_TableStyle_Tableau_indente_niv1_Body_0_0_RowSep_ColSep) with the property "page-break-inside: avoid;"

Am I missing something?
Or do I really have to choose between table stylesheets and the "page-break-inside" property?
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Avoiding table cell breaks with table stylesheets?

Post by Andrew »

If I recall correctly, the page-break-inside:avoid style does not work for ANY table in Word (if you use table styles or not).

In any case, you can apply the page-break-inside: avoid style to a table style using a couple of methods:

1) Modify your regular style sheet's tr element to set the page-break-inside to "avoid" -- this does carry through to the classes Flare applies to each row. The drawback is that it also carries through to all of your tables in any topic that uses that stylesheet. In many cases, this is not a problem, because you want ALL of your table rows to not break across pages, but it may be a problem in your case.

2) Modify the table stylesheet in a text editor. I haven't done this myself for page-break-inside: avoid, but theoretically it should work. This requires some understanding of what you are looking at in the table stylesheet. There are two major drawbacks: 1), you need to puzzle out how Flare makes the table styling work to properly edit the stylesheet, and 2) every time you modify the table style using Flare's TableStyle Editor, you will delete the changes you made manually to the table stylesheet, so you will have to redo them.

I heartily recommend method 1) if you can swing it. If, despite the drawbacks, you are interested in pursuing method 2, I can provide further help on it.
Flare v6.1 | Capture 4.0.0
Ingrid
Jr. Propeller Head
Posts: 2
Joined: Tue Oct 12, 2010 8:00 am
Location: Paris, France

Re: Avoiding table cell breaks with table stylesheets?

Post by Ingrid »

Thanks for your answer Andrew, but, as I said, method #1 works only if you don't apply a specific table stylesheet to the table.

My problem is to know how to use your method #1 ou #2 with a table style... and I don't think it is presently possible, unless I'm missing something.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Avoiding table cell breaks with table stylesheets?

Post by ChoccieMuffin »

Ingrid, are you doing something whizzy with your tables that specifically requires the use of a table stylesheet, or could you achieve your desired result with the regular styles in the normal stylesheet? If so, then perhaps you can get round the problem by not using table stylesheets at all. (Just a thought, I'm fairly new with Flare so that might be a completely dumb suggestion.)
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
Andrew
Propellus Maximus
Posts: 1237
Joined: Fri Feb 10, 2006 5:37 am

Re: Avoiding table cell breaks with table stylesheets?

Post by Andrew »

Ingrid wrote:Thanks for your answer Andrew, but, as I said, method #1 works only if you don't apply a specific table stylesheet to the table.

My problem is to know how to use your method #1 ou #2 with a table style... and I don't think it is presently possible, unless I'm missing something.
My confusion stems from the fact that page-break-inside: avoid does not work for any Word outputs or tables for me, regardless of table style or no table style. Not sure why I listed the methods...I think my brain got a bit scrambled. :oops:

Are you sure it is not your widows / orphans setting that makes it *appear* that the rows are not breaking across cells? What version of Word are you using?
Flare v6.1 | Capture 4.0.0
Post Reply