Home >Online Product Documentation >Table of Contents >Tables Tables
A table is a visual component that usually iterates over the data it contains. You typically create a table when you want your report to display multiple rows with two or more columns of dynamic data - one row for each movie in the If your data can be displayed in a single column (only movie titles, for example), you might want to consider using either the list or repeater components. See Lists and Repeaters for more information. Creating a TableThe easiest way to create a table in XML Publisher is to drag and drop a repeating element. When you drop the repeating element on the canvas, Stylus Studio displays a short-cut menu with an Insert Table choice. You can insert a table with either
You can also create a table manually (Report > Insert > Table, or select Insert Table from the canvas short-cut menu). When you create a table like this, however, the context and XPath are not set for you, and it will only contain the number of rows you explicitly create for it unless you also define the Loop property for a row. Graphical RepresentationTables, like the one shown in Figure 496, are displayed as a single row with a loop symbol ( ); the loop symbol indicates a repeating row. Figure 496 shows a table based on the Figure 497 shows a table based on the same repeating element, but it was created using the Default Columns short-cut menu choice. Finally, Figure 498 shows a table that was created manually using the Report menu. Notice that it does not have the loop symbol associated with repeating rows. SortingBy default, data for dynamic rows is displayed in document order. You can use an XPath expression in the Loop property's Sort sub-property to specify a different sort order. The Loop property appears on the Row tab of the Properties window. Adding Rows and ColumnsTo add rows and columns to a table:
1. Select the cell before or after which you wish to add a row or column.
2. Right-click.
Stylus Studio displays a short-cut menu. Alternative: Click the Report > Table menu.
3. Select the appropriate choice from the menu.
Deleting Rows, Columns, and TablesTo delete a row, column, or table:
1. Select a cell in the row or column you want to delete.
2. Click the Delete button in the toolbar (
).
Stylus Studio displays a drop-down menu. Alternative: Right-click. Alternative: Click the Report > Table menu.
3. Select the appropriate choice from the menu.
|