Page 1 of 1

table content linespacing

Posted: Tue Sep 20, 2022 11:09 am
by isemago
Hellow !

How can i doubled linespacing in table :?:

Code: Select all

    Table := aDocument.Paras.InsertTableAtPos(sel.FirstPos);
    Table.Name := vAliasName   
     table.AddRows(2, 3);
     for j := 0 to 2 do
     begin
       Table.Cells[0, j].Paras.PlainText := 'row ' + intToStr(j) + 'column 0';
       Table.Cells[1, j].Paras.PlainText :=  'row ' + intToStr(j) + 'column 1';
      end
 
     TableFormat:= TAXWPAPX.Create(aDocument.MasterPAP);
     TableFormat.LineSpacing := 2;
     Table.Paras.ApplyParaFormat(TableFormat, Table.FirstPara, Table.LastPara)
this doesn't work out.

Re: table content linespacing

Posted: Fri Sep 23, 2022 7:26 am
by larsa
Hello

You set the format for the table itself, not the cells.

To set the cells format, use this:

Code: Select all

   Table := FWriter.Editor.MainDoc.Paras.AddTable;

   TableFormat:= TAXWPAPX.Create(FWriter.Editor.MainDoc.MasterPAP);
   TableFormat.LineSpacing := 2;

   table.AddRows(2, 3);
   for j := 0 to 2 do begin
     Table.Cells[0, j].Paras.PlainText := 'row ' + intToStr(j) + 'column 0';
     Table.Cells[0, j].Paras.ApplyParaFormat(TableFormat,Table.Cells[0, j].Paras.First, Table.Cells[0, j].Paras.Last);

     Table.Cells[1, j].Paras.PlainText :=  'row ' + intToStr(j) + 'column 1';
     Table.Cells[1, j].Paras.ApplyParaFormat(TableFormat, Table.Cells[1, j].Paras.First, Table.Cells[1, j].Paras.Last);
    end;

Re: table content linespacing

Posted: Sat Oct 01, 2022 11:36 am
by isemago
thanks !