Table Cells |
Top Previous Next |
Table CellsThe main property of table is Cells[<Row>,<Col>]. <Row>,<Col> are indices of row and column, from 0. Attention: The Borland's grids use Cells[<Col>,<Row>] instead! The type of Cell[r,c] is TRVTableCellData. Each RichView control has a similar class inside (richview.RVData). Cell and richview.RVData are descendants from the same class designed to store formatted RichView document. Cells also have additional table-related properties (discussed below). Table RowsTables have another property: Rows. It is a list of table rows. Each row is a list of cells. Each row has the same number of cells (important!) So: ▪number of rows in table = table.Rows.Count; ▪number of columns in table = table.Rows[0].Count (each row has the same number of cells as the 0-th) ▪table.Cells[r,c] is the same as table.Rows[r][c]. Accessing and Modifying CellsIn editor, you need no special processing to access cells. Methods working with current/selected item(s) do it automatically (see more info). Cells have the most of the methods which RichView (not RichViewEdit!) has. For example: with table.Cells[r,c] do begin Clear; AddNLATag('hello!', 0, 0, ''); end; Read more about methods of cell.
Initially every cell contains one empty line of the 0-th text and paragraph style. Cells do not have editor-style methods. RichViewEdit creates special inplace editor to edit cell. |