trichview.com

trichview.support




Re: Table cell colors


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/18/2004 21:37:07


When you merge table cells, all the merged cells (except for the top left

one) become equal to nil.


The correct code is:


for r := 0 to FTable.Rows.Count-1 do

  for c := 0 to FTable.Rows[r].Count-1 do

    if FTable.Cells[r,c]<>nil then

    begin

      FTable.Cells[r,c].BorderColor:=BorderColorCBx.ChosenColor;

      FTable.Cells[r,c].Color := cellColorcbx.ChosenColor;

    end;



> I didn't see a table editor like there is for paragraph borders so I'm

> writing one and ran into a problem with odd tables.

>

> I was doing the following:

>

>   for r := 0 to FTable.Rows.Count-1 do

>     for c := 0 to FTable.Rows[r].Count-1 do

>         begin

>         FTable.Cells[r,c].BorderColor:=BorderColorCBx.ChosenColor;

>         FTable.Cells[r,c].Color := cellColorcbx.ChosenColor;

>         end;

>

> The problem is that if you split/merge cells I am getting an AV error. Is

> there a way to access every cell to adjust its background color?

> --

> Best regards,

> Harold Holmes

>

>





Powered by ABC Amber Outlook Express Converter