Hide Table and Cells Borders

General TRichView support forum. Please post your questions here
Post Reply
mark nong
Posts: 2
Joined: Thu Mar 03, 2011 2:39 am

Hide Table and Cells Borders

Post 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;

....
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
mark nong
Posts: 2
Joined: Thu Mar 03, 2011 2:39 am

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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)
Post Reply