<< Click to display table of contents >> Tables in TRichView Documents |
Tables arrange content in rows and columns. Each table cell is a subdocument containing its own items. Tables can be nested.
More details:
▪TRVTableItemInfo (see for detailed information).
Style of this item type: rvsTable (-60)
There is an important differences between properties of tables and properties of any other items. To change values of properties of any other item as an editing operation, you need to use special methods. But direct assignment to properties of TRVTableItemInfo is written to an undo buffer, if this table is already inserted in TCustomRichViewEdit.
This item type has the following specific string properties:
▪rvespImageFileName – value of this property can be saved in HTML file as table background image location; also accessible as table.BackgroundImageFileName.
The following viewer-style methods add item of this type to the end of the document:
▪AddItem (create TRVTableItemInfo object, add it using AddItem)
The following method returns TRVTableItemInfo object
The following editor-style method inserts item of this type at the position of caret:
▪InsertItem (create TRVTableItemInfo.object, insert it using InsertItem)
The following methods return TRVTableItemInfo object at the position of caret:
Users can resize table rows and columns, if rvtoRowSizing and/or rvtoColSizing are included in table.Options.
Resizing changes BestWidth and BestHeight properties of table cells.
OnItemResize event occurs after resizing.
Export to HTML
The TRichView's model of tables is very similar to the HTML model of tables, so tables are saved to HTML as they are.
The most of table visual properties can be saved only with use of CSS (use SaveHTMLEx method, or SaveHTML with rvsoForceNonTextCSS in Options parameter).
RTF and DocX Import
You can set RTFReadProperties.IgnoreTables to True, and tables in RTF/DocX will not be added in TRichView (contents of cells will be added in the main document).
RTF/DocX tables have different structure, TRichView does a smart work for converting them.
Text export
See the following properties of TRVTableItemInfo: