Syntax
| Printer.TableInit vsBorderSettings, Formatting, HeaderText
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| Defers table rendering until call to EndTable.
The TableInit method is used to render tables. The parameters describe the table format, the contents of a header row, and the border settings. The Printer object renders the table, automatically sizing rows and breaking pages when necessary.
When you start a new table, using TableInit, and use several TableAdd methods and TableCell properties, between calls to TableInit and TableEnd, the table is not rendered until the call to EndTable is made.
This allows you to perform complex formatting on the table using the TableCell property.
Instead of supplying the table data as strings, using the TableAdd method, you may also choose to supply data for individual cells separately. To do this, use the TableCell property.
By default, all tables created in Basic Script, carry the Tradium standard formatting rules, which means that the table rows have individual colors (white/cyan) and a yellow header background.
Aligning and indenting tables:
Tables may be aligned to the left, center, or right of the page depending on the setting in the Formatting string. To indent a table by a specified amount, use the TableCell property with the tcIndent setting.
The vertical position of the table is determined by the CurrentY property.
Drawing borders around tables:
Tables may have borders drawn around them. To specify or alter the type and appearance of the borders, you can use the TableBorder, PenColor, PenWidth, PenStyle, TablePen, TablePenLR, and TablePenTB properties.
You may also draw vertical and horizontal borders next to specific rows and columns using the TableCell property with the tcRowBorder and tcColBorder settings.
Formatting individual cells:
Use the TableCell property to set the cell format, including font, back and foreground colors, alignment, etc. This technique is efficient and easy to use.
You may also use RTF text in table cells. Just enclose the cell contents in curly brackets (e.g. "{Show me \b BOLD}"), but this technique is much slower than the other alternatives.
Populating a table:
Instead of supplying the table data as a string, you may set the contents of individual cells using the TableCell property with the tcText setting.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See Also
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example
|