Page 1 of 1

Hide Table and Cells Borders

Posted: Sun Mar 06, 2011 8:08 am
by mark nong
I draw a table in a RVE, and want to hide the table and cells borders, then save to a rtf file. But the borders is still visible in rft file.
How can i hidden the borders in rtf file?

Thank you,

nong

The following is my code:
....

t := TRVTableItemInfo.CreateEx(10, 2, rveZZ.RVData);
t.Options :=[rvtoHideGridLines];
RichViewTableGridStyle := psClear;
t.BorderWidth := 0;

rveZZ.InsertItem('', t);
rs := TMemoryStream.Create;
rveZZ.Format;
rveZZ.SaveRTFToStream(rs,false);
rveZZ.SaveRTF('c:\abc.rtf',false);
rs.Free;

....

Posted: Sun Mar 06, 2011 12:07 pm
by Sergey Tkachenko
To create a table without borders, assign

Code: Select all

t.BorderWidth := 0
t.CellBorderWidth := 0;
(if table grid lines are turned on in MS Word, it displays grid lines in place of borders, but they are not printed, and they can be turned off)

PS:
The line
t.Options :=[rvtoHideGridLines];
hides grid lines for this table. It does not affect neither borders not RTF output, it just instructs that the component should not draw grid lines for this specific table.
The line
RichViewTableGridStyle := psClear;
hides grid lines for all table. It does not affect neither borders not RTF output, it just instructs that the component should not draw grid lines for all tables.

Posted: Wed Mar 09, 2011 11:47 am
by mark nong
Thank Sergey

It Seem to be OK in word 2007.

And how can i modify the table rows height? tabel.heigh can not assign.

Posted: Wed Mar 09, 2011 7:03 pm
by Sergey Tkachenko
Assign Cell.BestHeight property for some cell in this row
(the height or row will be equal to the greatest BestHeight of its cells, or to the tallest content of its cell)