I have problems creating more than one table in a richtext.
The following code creates the first table correctly but the second one remains empty and the input strings are printed below the second table.
What's wrong there?
Code
procedure InsertNewTable(tablename: String; arr: Array of String);
var n: Byte;
begin
with Form1.WPRichText1 do begin
BeginTable(tablename,0,0,0);
AddTable(Length(arr),1,false);
MoveToTable(tablename);
TableRowNumber:=0;
for n:=0 to High(arr) do begin
TableColNumber:=n;
InputString(arr[n]);
end;
EndTable;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
InsertNewTable('Table1',['a','b','c']);
InsertNewTable('Table2',['1','2','3']);
end;
Alles anzeigen