Atomik Roundtrip 2.1: Tutorials > Chapter 10 Tutorial 7 : Generated Text << >>

9.3 Using tabular data in a text flow

Another common way to represent tabular data is to have text separated by tab characters in a standard QuarkXPress text box.

  1. Open RT_Tutorial7.qpt : this is a template into which we’re going to import the tabular data. You’ll notice that this just contains a couple of normal text boxes - but these boxes are going to contain our table.

Whereas a QuarkXPress table has separate ‘cells’ for each piece of data, a table created using a text box in QuarkXPress simply uses the tab character to give the impression of columns of data. Where we inserted a ‘new box’ character to move from one cell to the next in a QuarkXPress table box, for a text table we will instead use a tab character (the character which is inserted into the text flow when you press the ‘Tab’ key on the keyboard).

  1. Next we need to create a ruleset for the XML which we are about to import. In order to do this, select ‘Create -> Create Ruleset...’ from the Atomik Roundtrip menu. Again, you will be prompted to choose a DTD and name the ruleset - select ‘Tutorial 7.DTD’ from the DTD pop-up menu, and enter ‘Tutorial7b.rls’ as the name of the ruleset.
  1. You’ll then be prompted to select an XML file to import - choose the file ‘Tutorial7b.xml’.
  2. For the first rule in this ruleset, make a rule for the ‘TableData’ element which adds a Tab character after each occurence of the element. If you’re not sure how to do this, take a look back over the earlier sections of this Tutorial, and also Tutorials 3 and 6.
  3. Next we’re going to create some rules which will ensure that our table’s columns are appropriately placed. The easiest way to ensure that all the tabs in a table appear in the right place is to define a QuarkXPress paragraph style sheet and apply it to the text. We’ve already defined some suitable styles in the template you’re working with, so all you need to do now is to make some rules to use them.
  4. • Make a rule to apply the style ‘01 Table Head Row Bold’ to ‘TableHeadRow’ elements. As this rule will be applying a paragraph style sheet, ensure that you check the ‘Is a Paragraph’ checkbox in the ruleset dialog.
  5. • Make a rule to apply the style ‘01 Table Data Row’ to ‘TableDataRow’ elements. Again, make sure you check the ‘Is a Paragraph’ checkbox.
  6. • Make a rule to append a ‘New Box’ character to the end of each table element.
  7. Now your ruleset is ready to import your data onto the page. So now close the ruleset palette, and switch to the ‘XML’ tab of the Roundtrip XML palette. Simply drag & drop the Publication element into the large empty text box on the left hand side of the page, and your XML content will be flowed into the text box in a tabular format, which should (hopefully) look like the illustration above.