Hello,
I am attempting to create a series of tables in a document. I want the border of the table to be visible but the borders of the individual cells to be invisible. I have tried several methods to hide the cell borders as documented in the code below. Please let me know what I'm missing.
Also, I need to output the document to RTF and have the tables be invisible there as well.
Thank you,
Karl
Code Snippet:
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TRVTableItemInfo* rvTable = new TRVTableItemInfo(13,2, RichViewEdit1->RVData);
rvTable->BorderStyle = rvtbRaised;
rvTable->BorderWidth = 2;
rvTable->BorderVSpacing = 1;
rvTable->BorderHSpacing = 1;
// Attempt to get rid of the cell borders by setting width to 0
// rvTable->CellBorderWidth = 0;
// Attempt to hide cell borders by setting color to white.
// rvTable->CellBorderColor = clWhite;
for (int iRow = 0; iRow < rvTable->Rows->Count; iRow++)
for (int iCol = 0; iCol < rvTable->Rows->Items[iRow]->Count; iCol++)
{
TRVTableCellData* rvtCell = rvTable->Cells[iRow][iCol];
rvtCell->BestWidth = 100;
if (iRow == 0)
rvtCell->BestHeight = 20;
else
rvtCell->BestHeight = 10;
// Another attempt to hide the cell borders.
rvtCell->VisibleBorders->Left = false;
rvtCell->VisibleBorders->Right = false;
rvtCell->VisibleBorders->Top = false;
rvtCell->VisibleBorders->Bottom = false;
// One more attempt to hide the cell borders.
// rvtCell->BorderColor = clWhite;
}
// Put heading in row 0, col 0.
rvTable->Cells[0][0]->AddNL("Wafer/Summary Information", 1, -1);
// Now merge row 0 col 1 and 2.
rvTable->MergeCells(0,0,2,1,true);
// Lot ID row
rvTable->Cells[1][0]->AddNL("Lot ID:", 0, -1);
rvTable->Cells[1][1]->AddNL("Lot 1", 0, -1);
RichViewEdit1->InsertItem("", rvTable);
}
Invisible Cell Borders
-
- Site Admin
- Posts: 17566
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
As for attempt to make cell borders white: it will work only if
rvTable->CellBorderStyle= rvtbColor;
rvTable->CellBorderWidth = 1; // any positive value
rvTable->CellBorderColor = clWhite;
(and VisibleBorders for all cells are true)
As for attempts to hide cell borders by assigning CellBorderWidth = 0 or using VisibleBorders: borders are hidden, but table grid lines are shown in editor (grid lines are not displayed in viewer or when printing).
You can hide grid line for the specific table:
rvTable->Options << rvtoHideGridLines;
or for all tables:
RichViewTableGridStyle = psClear;
rvTable->CellBorderStyle= rvtbColor;
rvTable->CellBorderWidth = 1; // any positive value
rvTable->CellBorderColor = clWhite;
(and VisibleBorders for all cells are true)
As for attempts to hide cell borders by assigning CellBorderWidth = 0 or using VisibleBorders: borders are hidden, but table grid lines are shown in editor (grid lines are not displayed in viewer or when printing).
You can hide grid line for the specific table:
rvTable->Options << rvtoHideGridLines;
or for all tables:
RichViewTableGridStyle = psClear;