Tables in TRichView
Tables
RichView documents can include tables. Each table cell can contain formatted contents with 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 the style and colors of borders around the table, defaults for all of its cells, or specific values for any given cell. Moreover, tables can be inserted in a paragraph with their own borders, and cells can include paragraphs with borders.
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 the color of a table as a whole or the color of any cell. You can hide some sides of cells' borders.
RichView tables are designed using the HTML model. In this model, every cell in a table has its own distinct border on all four sides. In addition, the table as a whole has a border, distinct from the cells in the table. The borders of adjacent cells may touch but are never combined.
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 RichView, for example by assigning cell-spacing to -1 or 0.
Contents of cells can be aligned vertically (to the top, bottom or middle of the cell).
Tables and cells can have background images. Background images can be centered, tiled, or stretched. Transparent images are supported.
Width and Height
As described above, RichView tables are designed using the HTML model. Widths of columns are calculated by the component based on the widths of individual cells. Widths of cells (and table as a whole) can be defined in pixels or in percents.
The height of a cell can be calculated based on its contents or defined in pixels.
Widths of columns and heights of rows can be changed with the mouse.
Undo and Redo
If a table is inserted using the editor, all operations on the 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 part of an RTF (Rich Text Format) document. RichView supports the import of tables from RTF files saved both by the standard of Microsoft Word 6 and 97, and by the standard of Word 2000 (which includes many new keywords for HTML-like properties). RichView does a very smart job converting tables from RTF to its internal HTML model.
The component can export tables in RTF, HTML (with or without using Cascading Style Sheets (CSS)), and text files.
You can see an example of importing tables from RTF file and saving them as HTML on this page.
Printing
The component can print tables in a RichView document. If a table does not fit a page, it may be printed on several pages (separation is allowed only between rows, and can be forbidden in the options for the table).
Tables can have heading rows which will be repeated on each page.
How To...
Additional information from the support forum:
|