richview 添加表格

richview 添加表格
procedure TForm1.mitInserttable1Click(Sender: TObject);
var
table: TRVTableItemInfo;
r, c: Integer;
begin
table := TRVTableItemInfo.CreateEx(4, 3, RichViewEdit1.RVData);

table.BorderStyle := rvtbRaisedColor;
table.CellBorderStyle := rvtbLoweredColor;
table.BorderLightColor := $00FAF1C9;
table.BorderColor := $00A98E10;
table.CellBorderLightColor := $00FAF1C9;
table.CellBorderColor := $00A98E10;
table.Color := $00EAC724;
table.BorderWidth := 5;
table.CellBorderWidth := 2;
table.CellPadding := 5;
table.CellVSpacing := 1;
table.CellHSpacing := 1;
table.BorderVSpacing := 1;
table.BorderHSpacing := 1;

for r := 0 to table.Rows.Count - 1 do
for c := 0 to table.Rows[r].Count - 1 do
table.Cells[r, c].BestWidth := 100;

table.MergeCells(0, 0, 3, 1, False);
table.MergeCells(1, 0, 1, 3, False);
with table.Cells[0, 0] do
begin
Color := clInfoBk;
Clear;
AddBullet('', 0, il, 2);
AddNL(' Example 1 ', 1, -1);
AddBullet('', 0, il, -1);
AddNL('All cells have 100 pixels width, width of table itself is calculated basing on width of cells.',
0, 0);
end;

if RichViewEdit1.InsertItem('', table) then
begin
RichViewEdit1.Format;
end;
end;
免责声明:本网信息来自于互联网,目的在于传递更多信息,并不代表本网赞同其观点。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,并请自行核实相关内容。本站不承担此类作品侵权行为的直接责任及连带责任。如若本网有任何内容侵犯您的权益,请及时联系我们,本站将会在24小时内处理完毕。
相关文章
返回顶部