Hiding rows in RTF tables with merged cells?

  • Thread starter Chris Shearer Cooper
  • Start date
C

Chris Shearer Cooper

My application generates its output in RTF format and then uses a
commercially available editor (not Word) to display the output to the user.
One of the things I need to do, is generate tables like this:

A C
B C

so it's a table with two rows and two columns, but the two cells in the
second column are vertically merged.

The problem is, if the text in the merged column is extra-long, it makes the
row containing 'B' taller to fit all its text. That's reasonable, but makes
B look ugly, What I want is more like this ...

A C
B C
x C

where that third row contains no text in the 'x' cell, and the row
containing x only shows up if the text in C is long enough to require it.

So, trying to draw this, instead of seeing this ...
+---+---+
+ A + C +
+---+ C +
+ B + C +
+ + C +
+ + C +
+ + C +
+---+---+
(notice all the blank space in the row containing B)

I want to see this (hard to show in proportional fonts, sorry, and I'm not
sure if it's safe to do HTML formatting)
+---+---+
+ A + C +
+---+ C +
+ B + C +
+---+ C +
+ + C +
+ + C +
+---+---+

But if the stuff in 'C' is short, I want to see
+---+---+
+ A + C +
+---+ C +
+ B + C +
+---+---+

and not
+---+---+
+ A + C +
+---+ C +
+ B + C +
+---+ +
+ + +
+---+---+

I tried adding a blank row at the end, and putting absolutely no content in
it, but it seems like RTF assumes that if you have a row, it gives it by
default the height of the default font.

Any suggestions?

Thanks!
Chris
 
R

Robert M. Franz (RMF)

Hi Chris
My application generates its output in RTF format and then uses a
commercially available editor (not Word) to display the output to the user.
One of the things I need to do, is generate tables like this: [..]
But if the stuff in 'C' is short, I want to see
+---+---+
+ A + C +
+---+ C +
+ B + C +
+---+---+

and not
+---+---+
+ A + C +
+---+ C +
+ B + C +
+---+ +
+ + +
+---+---+

I tried adding a blank row at the end, and putting absolutely no content in
it, but it seems like RTF assumes that if you have a row, it gives it by
default the height of the default font.

Any suggestions?

I guess you need to "fork" (decide on run-time whether C is "short" or
not, and accordingly insert the desired table ...).

0.2¢
Robert
 
K

Klaus Linke

Ben Voigt said:
Use nested tables instead of merged cells.


Sounds to me as if you want the two columns to act pretty independently?

So maybe a single column table on a 2-column page (A, B in the first column,
C in the second).
(Spacing between page columns zero, width of table equal width of page
column)

Regards,
Klaus
 
C

Chris Shearer Cooper

I don't think I've ever tried to do a nested table - or realized there was
such a thing!

So ... I could imagine having the "outside" table that just had two columns,
and then have a nested ("inside") table inside the first column that had 2
rows, and then my text in the second column of the outside table? That way,
my "inside" table would draw his border under his last entry (the "B" in my
original example) and the "outside" table would draw his border along his
bottom margin, that sounds like it just might work!

How do I do a nested table? I just tried and couldn't get it to work.

Thanks,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top