Discussion:
Keep with Next and Merge Cells
(too old to reply)
Rahul
2008-02-08 22:32:00 UTC
Permalink
Hi,

I've a Table that I dont want to split accross pages. From one of the MVP
sites I found that the right way to do this is by unchecking the "Allow rows
to break accross pages" followed by "Keep with next" for all except the last
row.

Now I've a Table here that I did a merge cells on a few rows but only for
the first 3 columns.

The question is how do I not get the same behaviour? Which exactly is my
last row now? How does WQord handle these merged rows in its internal row
count?

Any advice?

Thanks!

-Rahul
Lene Fredborg
2008-02-09 21:29:01 UTC
Permalink
As I understand your question, you have vertically merged cells that span the
last rows in one or more columns in the table (e.g. a table with 3 columns,
10 rows – cells 8-10 in column 1 are merged).

Word counts the last physical cell in a column as the last cell. However, if
you turn off "Allow row to break across pages", this should prevent any cell
from breaking across pages. Therefore, seen from a logical point of view, you
should always be able to prevent the table from breaking across pages if you
apply "keep with next" to all rows until the row that contains the topmost
cell that makes up the last cell in a column (a bit difficult to explain… -
in the example above: select the first 7 rows) – this also worked
consistently for me when testing.

If you select the columns individually one by one – without the last cell –
and apply "Keep with next", this will also keep the table on one page but it
is more cumbersome.
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
Post by Rahul
Hi,
I've a Table that I dont want to split accross pages. From one of the MVP
sites I found that the right way to do this is by unchecking the "Allow rows
to break accross pages" followed by "Keep with next" for all except the last
row.
Now I've a Table here that I did a merge cells on a few rows but only for
the first 3 columns.
The question is how do I not get the same behaviour? Which exactly is my
last row now? How does WQord handle these merged rows in its internal row
count?
Any advice?
Thanks!
-Rahul
Rahul
2008-02-13 22:22:02 UTC
Permalink
Thanks Lene! That worked great for me.
Post by Lene Fredborg
As I understand your question, you have vertically merged cells that span the
last rows in one or more columns in the table (e.g. a table with 3 columns,
10 rows – cells 8-10 in column 1 are merged).
Word counts the last physical cell in a column as the last cell. However, if
you turn off "Allow row to break across pages", this should prevent any cell
from breaking across pages. Therefore, seen from a logical point of view, you
should always be able to prevent the table from breaking across pages if you
apply "keep with next" to all rows until the row that contains the topmost
cell that makes up the last cell in a column (a bit difficult to explain… -
in the example above: select the first 7 rows) – this also worked
consistently for me when testing.
If you select the columns individually one by one – without the last cell –
and apply "Keep with next", this will also keep the table on one page but it
is more cumbersome.
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
Post by Rahul
Hi,
I've a Table that I dont want to split accross pages. From one of the MVP
sites I found that the right way to do this is by unchecking the "Allow rows
to break accross pages" followed by "Keep with next" for all except the last
row.
Now I've a Table here that I did a merge cells on a few rows but only for
the first 3 columns.
The question is how do I not get the same behaviour? Which exactly is my
last row now? How does WQord handle these merged rows in its internal row
count?
Any advice?
Thanks!
-Rahul
d***@gmail.com
2012-08-02 14:23:54 UTC
Permalink
I'm having the same issue, but I want even the vertically merged cells to not break off. Is there a way for this to happen?

Thanks,
David Schenkler
Stefan Blom
2012-08-02 18:34:35 UTC
Permalink
You haven't cited the original post in this (possibly old) thread, so I can't
tell what has been suggested earlier. Anyway, applying "Keep with next"
paragraph formatting to whole table rows should work even with merged cells. Are
you saying that it doesn't work for you?
--
Stefan Blom
Microsoft Word MVP




wrote in message news:5fe3d705-1880-4c93-a67c-***@googlegroups.com...

I'm having the same issue, but I want even the vertically merged cells to not
break off. Is there a way for this to happen?

Thanks,
David Schenkler
d***@gmail.com
2012-08-03 13:02:28 UTC
Permalink
Sorry, I didn't know that. I am new to this.
Yes, it did not work for me. But I decided to get rid of the code to disallow the row to break off pages, because the the table was really big, and since it ran off the page both vertically and horizontally anyway, and it looked really bad even after autofitting window and contents, I decided that not allowing the rows to break off pages was too much to ask for. Instead I am having other questions that are related to tables.

My Word template is set up so that it will merge the information from a different tool's program into MS Word. This way I get a nice report in Word. As such, I have to word the template a certain way, and then play with the document to make it look nice, hence the Macros. However, my problem lies with the tables. Sometimes there 2x2 (or bigger) tables that have the first column being labeled as what the other table will be saying.

Example:
--------------------------
|Dependents: | <<code>> |
|_____________|__________|
|Dependencies:| <<code>> |
|_____________|__________|

The <<code>> will turn into the information that is located in the other tool after running its program. My higher ups want to know two things:
1) Is there a way to make it so that if one of the cells is empty that that entire row is deleted?
2) No one is sure if they want a certain object in the generated reports or not. This object happens to be in a 2x2 table (as seen above). The template is simple and only 2 tables are in the template (both are the same thing, just labeled differently). But after running the tool's program, many tables will be generated. Is there a Macro code that can allow the person to decide if he/she wants these tables to be put in?

Thank you,
David Schenkler
Post by Stefan Blom
You haven't cited the original post in this (possibly old) thread, so I can't
tell what has been suggested earlier. Anyway, applying "Keep with next"
paragraph formatting to whole table rows should work even with merged cells. Are
you saying that it doesn't work for you?
--
Stefan Blom
Microsoft Word MVP
I'm having the same issue, but I want even the vertically merged cells to not
break off. Is there a way for this to happen?
Thanks,
David Schenkler
You haven't cited the original post in this (possibly old) thread, so I can't
tell what has been suggested earlier. Anyway, applying "Keep with next"
paragraph formatting to whole table rows should work even with merged cells. Are
you saying that it doesn't work for you?
--
Stefan Blom
Microsoft Word MVP
I'm having the same issue, but I want even the vertically merged cells to not
break off. Is there a way for this to happen?
Thanks,
David Schenkler
Stefan Blom
2012-08-03 18:10:47 UTC
Permalink
OK, so the problem is with applying "Keep with text" to merged cells in *code*.
You should ask this question in a programming group or forum, where you are more
likely to get a knowledgeable reply. You could try the programming forum at
Answers
(http://answers.microsoft.com/en-us/office/forum/customize?page=1&tab=all) or
some
MSDN forum (such as
http://social.msdn.microsoft.com/Forums/en-US/worddev/threads).
--
Stefan Blom
Microsoft Word MVP




wrote in message news:675ed6a7-55eb-4106-8498-***@googlegroups.com...

Sorry, I didn't know that. I am new to this.
Yes, it did not work for me. But I decided to get rid of the code to disallow
the row to break off pages, because the the table was really big, and since it
ran off the page both vertically and horizontally anyway, and it looked really
bad even after autofitting window and contents, I decided that not allowing the
rows to break off pages was too much to ask for. Instead I am having other
questions that are related to tables.

My Word template is set up so that it will merge the information from a
different tool's program into MS Word. This way I get a nice report in Word. As
such, I have to word the template a certain way, and then play with the document
to make it look nice, hence the Macros. However, my problem lies with the
tables. Sometimes there 2x2 (or bigger) tables that have the first column being
labeled as what the other table will be saying.

Example:
--------------------------
|Dependents: | <<code>> |
|_____________|__________|
|Dependencies:| <<code>> |
|_____________|__________|

The <<code>> will turn into the information that is located in the other tool
after running its program. My higher ups want to know two things:
1) Is there a way to make it so that if one of the cells is empty that that
entire row is deleted?
2) No one is sure if they want a certain object in the generated reports or not.
This object happens to be in a 2x2 table (as seen above). The template is simple
and only 2 tables are in the template (both are the same thing, just labeled
differently). But after running the tool's program, many tables will be
generated. Is there a Macro code that can allow the person to decide if he/she
wants these tables to be put in?

Thank you,
David Schenkler
Post by Stefan Blom
You haven't cited the original post in this (possibly old) thread, so I can't
tell what has been suggested earlier. Anyway, applying "Keep with next"
paragraph formatting to whole table rows should work even with merged cells. Are
you saying that it doesn't work for you?
--
Stefan Blom
Microsoft Word MVP
I'm having the same issue, but I want even the vertically merged cells to not
break off. Is there a way for this to happen?
Thanks,
David Schenkler
You haven't cited the original post in this (possibly old) thread, so I can't
tell what has been suggested earlier. Anyway, applying "Keep with next"
paragraph formatting to whole table rows should work even with merged cells. Are
you saying that it doesn't work for you?
--
Stefan Blom
Microsoft Word MVP
I'm having the same issue, but I want even the vertically merged cells to not
break off. Is there a way for this to happen?
Thanks,
David Schenkler
k***@gmail.com
2015-03-19 01:22:49 UTC
Permalink
Post by d***@gmail.com
I'm having the same issue, but I want even the vertically merged cells to not break off. Is there a way for this to happen?
Thanks,
David Schenkler
Hi - reviving this old, old thread again.

So I'm having the same issue. I have a table in which the first column contains a classification. So it spans (merged) multiple rows. The table is quite big and I won't to allow it to break between the classifications.

When I disable 'Allow row to break ...' it does not have any effect on the merged row.
I can enable 'Keep with Next' in paragraph but this does not have the required effect. If I enabled it on the merged row - the whole table is kept together. If I enabled it only on the first (and not the last) row behind the classification. It has not the expected effect, i.e. the last row is still cut off. If I enabled it on all classified row but not the merged classifier cell, the first row is kept as an orphan.

Is there a way to achieve what I'm after?

Loading...