About Arbortext Styler > Adding Generated Text > Inserting Tables in Generated Text
  
Inserting Tables in Generated Text
You can insert tables in generated text. It is useful to use tables as a layout tool, to align text and graphics side by side in a title, for example.
* 
Generated text includes that produced within header and footer objects. Refer to Adding Headers and Footers to a Page Set for information on adding headers and footers to your documents.
Example: Inserting a Table in Generated Text
The procedure below describes how to include a graphic and some inline text in the title of the note elements in your document.
1. In Arbortext Editor, open the transport.xml document located at Arbortext-path/samples/styler.
2. Choose Styler > Edit Stylesheet to open the stylesheet currently associated with the document for edit. This is a read only stylesheet so you will need to save a local copy if you want to make amendments.
3. Click on the title in note context in the Elements list.
4. Go to the Generated text category.
5. Click Edit next to the Before-text field. The Generated Text Editor opens.
6. Choose Insert > Table. The Insert Table dialog box opens.
7. Select table in the Wrapper Tags field.
8. In the Table Size field, set Rows to 1 and Columns to 2 .
9. Click OK to exit the dialog box. The Generated Text Editor now displays a two column table.
10. Place your cursor in the first cell of the table, and choose the Table > Select > Table menu option to select the entire table.
11. Choose the Table > Modify Borders menu option. The Modify Borders dialog box opens.
12. Change the selection in the Apply To option to Table.
13. Click the None button in the Presets section.
14. Click OK to exit the Modify Borders dialog box. The Generated Text Editor now contains a table without borders.
15. Place your cursor in the first cell of the table, choose Table > Table Properties, and select the Column tab in the Table Properties dialog box.
16. In the Width field, select the Fixed option and enter 100.00pt in the Fixed Width field.
17. Click the Cell tab in the Table Properties dialog box. In the Justification field, set the Horizontal field to Center and the Vertical field to Top.
18. Click OK to exit the Table Properties dialog box.
19. Place your cursor in the second cell of the table, choose Table > Table Properties, and select the Cell tab in the Table Properties dialog box.
20. In the Justification field, set the Horizontal field to Left and the Vertical field to Centered.
21. Click OK to exit the Table Properties dialog box.
22. Place your cursor in the first cell then choose Insert > Graphic. The Locate Graphic File to Reference dialog box opens.
23. Browse to the graphic that you want to be displayed in the first cell of the table, for example the graphic cmt.gif from the Arbortext-path/graphics directory.
24. Place your cursor in the second cell and enter the text Source: followed by a space.
25. After the text, choose the Insert > Element Content menu option. The Insert Element Content dialog box opens.
26. Select corpauthor from the Of list and ensure that the Element content option is selected.
27. Choose first from the Occurrence list and (Whole Document) from the Within list. These two steps will advise Arbortext Styler that the contents of the corpauthor element should be output in the second cell of the table, after the specified text.
28. Click OK to exit the dialog box. The Generated Text Editor now shows an ElementContent object in the second cell, after the text.
This is an image of the Generated Text Editor for the title in note context, showing a table with 2 columns and 1 row. The first column contains a _gentextgraphic element followed by the inserted graphic, and the second column contains the text Source: followed by an ElementContent element
29. Select the ElementContent tag in the second cell, and choose the Format > Font menu option. The Modify Font dialog box opens.
30. Set Color to Red. Note that this font color will apply only to the text generated by the ElementContent object, the rest of the generated text in the title will inherit its formatting properties from the note element.
31. Click OK. The Generated Text Editor will show the table as it has been configured, with the ElementContent object surrounded by a _font wrapper:
This is an image of the Generated Text Editor for the title in note context, showing a table with 2 columns and 1 row. The first column contains a _gentextgraphic element followed by the inserted graphic, and the second column contains the text Source: followed by an ElementContent element that is wrapped in a _font tag
32. Choose File > Apply and Close to save the gentext setting and exit the editor.
33. Choose Preview > Print.
Note that the title of the first note in the document contains the selected graphic on the left, and the content of the corpauthor element on the right.