Tables in TRichView
Documents can contain tables. Each table cell contains formatted sub-document that can consist of multiple paragraphs, including images, Delphi/C++Builder controls, and other tables.
Tables can be nested to any depth.
Cells can be merged together in one larger cell, both horizontally and vertically.
Layout and Appearance (Borders, Rules, Colors)
Tables have a rich set of properties defining their layout.
You can specify a style and colors of borders around the table, defaults colors for cell borders, or colors for specific cell borders.
Moreover, tables can be inserted in a paragraph having its own border, and cells can include bordered paragraphs as well.
Borders may be flat or three-dimensional.
In addition to borders, tables can have optional rules – horizontal and/or vertical lines between cells.
You can define background colors and opacity for the whole table or for specific cells. You can hide sides of table and cell borders.
Tables in TRichView are designed using an HTML model.
In this model, every cell in a table has its own distinct border at all four sides. In addition, the table as a whole has a border, distinct from the cells in the table.
Many RTF editors use another model of table borders, where borders exist "between" cells, centered on the line between the cell edges. Such borders can be simulated in TRichView by using a negative cell-spacing.
Contents of cells can be aligned vertically (to the top, bottom or middle of the cell) or rotated by 90°, 180° or 270°.
Tables and cells can have background images. Background images can be centered, tiled, or stretched. Transparent images are supported.
Width and Height
As it's described above, TRichView tables are designed using the HTML model.
Widths of columns are calculated by the component based on widths of individual cells.
Widths of cells (and of a table as a whole) can be defined as absolute values (pixels or twips*), or defined relative to the parent document width (percent).
Height of cells can be calculated based on their contents or defined as absolute values (pixels or twips).
Widths of columns and heights of rows can be changed with the mouse.
* twip is defined as 1/20 of point, or 1/1440 of inch.
Undo and Redo
If a table is inserted in an editor, all operations on this table can be undone and redone.
Undoable operations include: typing in cells, resizing with the mouse, cell merging, adding and removing rows and columns, changing visual properties (such as colors or spacing).
Import and Export
The component can import tables as a part of an RTF (Rich Text Format) document.
TRichView supports import of tables from RTF files saved both by the old standards (Microsoft Word 6 and 97), and by the new standards (which include many keywords for HTML-like properties).
TRichView does a very smart job converting tables from RTF to its internal HTML model.
The component can export tables to DocX, RTF, HTML (with or without using Cascading Style Sheets (CSS)), and text files.
The component can print tables in a TRichView document. If a table does not fit a page, it may be printed on several pages.
Tables can have heading rows which will be repeated on each page.
Limitation: while TRichView supports page breaks inside table cells, ScaleRichView does not (ScaleRichView supports page breaks only between table rows)
Table Operations in RichViewActions
RichViewActions support the following table operations:
- editing properties of tables, selected rows, selected cells;
- selecting a table; selecting the whole rows or columns containing the selected cells;
- deleting rows and columns;
- inserting rows and columns above or below the selected cells;
- converting a table to text;
- merging the selected cells;
- un-merging and splitting the selected cells;
- sorting table rows;
- splitting a table into two tables;
- showing and hiding table grid lines.
RichViewActions “Table properties” dialog
Additional information from the support forum: