Selecting A cell in a table

General TRichView support forum. Please post your questions here
Post Reply
fara2000
Posts: 42
Joined: Mon Sep 07, 2015 5:59 pm

Selecting A cell in a table

Post by fara2000 »

Hello Sergey
In the Line Table1.cells[table1.RowCount-1,0].SetItemText(0,'Hello');
I need to force Aligning the word 'Hello' horizontally at the center of the Cell. How to do that???
Thank you in advance
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Selecting A cell in a table

Post by Sergey Tkachenko »

In TRichView, horizontal alignment in cell is defined just like in normal document: in paragraph properties.
To center text, its paragraph must have property Alignment = rvaCenter.

You can call
Cell.Clear;
Cell.AddNL('Hello', 0, ParaNo);
where ParaNo is an index (in RVStyle.ParaStyles[]) of item having Alignment = rvaCenter.
Post Reply