Setting up a Table
The first thing we need to do is create a Table Style in CatBase.
- On the main window, click on the Style Sheets button
- Choose Tables from the popup menu
- Click on Create a New Record
A new Table Style record will open up. Select the InDesign tab:
- Enter a name for your new table style
- If you are using InDesign CS3 or later, you can select the Use CS3 Table Styles option. This will enable you to have more control over the styling of your tables once they have been imported into your InDesign layout.
- Set up the other options. I won't go into detail about those options here: they match the options found in InDeisgn. HOWEVER, if you are using the CS3 Table Styles option, you can ignore most of these settings, as they will be controlled by the Table Style in your InDesign document. The only settings that you need to be concerned with are:
- Body Style Sheet: Select the default stylesheet to use for the table body rows
- Headers: Go to the Headers/Footers tab, where you will see the Include Header Row option, which is selected by default. Un-check this option if you don't want a header row; otherwise, select the style sheet to use for styling the header rows.
- Save your Table Style.
Now we are ready to tell CatBase exactly what data to put into the table. If you are not already familiar with CatBase's Publishing Style Sheets, it would probably be helpful for you to take a quick look at the Publishing Style Sheets Tutorial.
For this Tutorial we're going to publish a price list showing the name of each Photographer in our Demo Database followed by a table listing the photos each one is offering for sale. It will look something like this:
- Create a new Publishing Style Sheet (Style Sheets->Publishing Style Sheets->Create a New Record)
- Enter a name for your new Publishing Style Sheet
- Make sure that the selected Publishing Destination is InDesign or InDesign with Xtags
- Select the appropriate Base Table (Photographers, in our example)
- Click the Add a Paragraph button to create a new Paragraph. I'm keeping this tutorial as uncluttered as possible, so I'm just going to publish each photographer's name.
- Add the Elements you need to the Paragraph. For my example, I've added three Elements: First Name, a space, and Last Name.
- Save that Paragraph
- Create a second Paragraph
- Name this Paragraph "Pictures". Don't bother to select a Stylesheet - you'll see why in a moment
- Add a new Element. In our demo database, we have set up a relation between Photographers and Pictures: in other words, we have our data stored in two separate tables. In the Photographers table we have basic Photographer details such as their names and addresses, and in the Pictures table we have details of each individual picture that we are offering in our catalogue. The Pictures are related (or linked) to the Photographers. We want to find each Photographer's Pictures, sort them by name, and put them into a table.
- Select the Relation element type.

- Click on the Relations button to see the possible relations for your base table, and make sure that the correct relation is selected.
- In my example, I've already got a Sort Format set up for the Pictures table (Name) and this has been selected by default. You might need to create a new Sort format to designate how the related data will be sorted: to do that, click on the New Sort Format button.
- Now we are ready to tell CatBase what data to publish for each Picture. Click on the +Para' button to add a new Paragraph to the Relation.
- Where tables are concerned, think of each row in the table as one paragraph. So, we just need to add the columns to our table. Think of each Element in the Paragraph as as a column in the table. For this example, we want to include four columns in each table: the picture name, description, framed price and unframed price.
- Enter a name for the Paragraph and choose a stylesheet. Note that the stylesheet you choose here will not be used to format the CONTENT of the table: it will be used to format the paragraph that the table sits in. So if you want your table to be centered on the page, choose a stylesheet that is set to be centered.
- Click on the Preferences tab.
- Select the Create a table from this Paragraph check box, and choose the Table Style that you want to use:
- Go back to the Details tab
- Click on Add an Element
- Choose the field for the first column; in my example, it's the Name field.
- Click on the Tables tab
This tab is divided up into three main areas.
Column Header
By default, the header for this column will be the name of the field that was selected ("Name" in my example), and it will be static - ie, the same for every instance of the table. You can change this text to whatever you want.
But what if you want your table headings to be more dynamic? A typical example is when you are publishing a table listing parts available for each product that you make. The headings will vary depending on the type of part - for example, perhaps the second column in the table might contain the width of the part for some types, and for other types it might contain the weight or the ampage or whatever. In that case, you could store the column headings in a field in the Products table. You would then select the Field data: radio button, and the display will change:
The popup Tables menu lists all your active tables, and the popup Fields menu lists all the fields in the selected table. In the Products-Parts example, you would select the Products table and then choose the field in the Products table that contains the text for the column header.
You can also choose a different stylesheet for any column header. You might, for example, want to set the headers for the pricing columns in bold.
Column
This is where you tell CatBase how wide to create each column, whether you want to fill it with a colour, and whether you want to use a different stylesheet from the default table data style (which was selected in the Table Style, remember?).
Column Width: You can specify a set width for the column, or you can tell CatBase to calculate the width for each table based on the contents of that column.
Cell Fill Colour: By default, the column will have no background colour. But you can select a different colour for each column if you wish. Here's an example of how this option might be put to good use:
Style Sheet: The Default Paragraph Style is the style sheet that was selected for the Body Style Sheet in the Table Style. You can choose a different stylesheet for each column if you wish.
Grouping
Sometimes you might need to combine data from more than one Element into one table column - for example, a person's first name and last name. You would select the Group in one cell option for those Elements.
- After you've selected the table options, save the Element.
- Add additional Elements as needed
- Save the Relation Paragraph
- Hit the Save button a couple more times until you are back to the main window for your Publishing Style Sheet. Just one more thing to do ...
- Click on the Prefs tab and choose a Sort Order, then save your Publishing Style Sheet.
OK, I've set up my table with four Elements, which will become four columns:
- Name (3cm wide)
- Description (10 cm wide)
- Price Framed (2 cm wide)
- Price Unframed (2cm wide)
Now I'm ready to publish my data.
Publishing the table
My Publishing Style Sheet is based on the Photographers table: I want to list each Photographer, sorted alphabetically by last name, with each Photographer's table of Pictures below his name. So I need to start by making a list of the Photographers I want to include.
- At the main window, click on the Find Data button, choose Photographers from the pop-up menu, and click on View All Records.
- With the list of Photographers displayed, click on the Publish button at the top of the window.
- Select the appropriate Publishing Style Sheet and click OK
- Enter a name for the file and save it.
When CatBase has finished creating the file ...
- Open your InDesign template, or create a new document with a default text box
- Click in the text box
- Choose Place from the File menu (or choose Import text with Xtags if you are using the Xtags plugin)
- Locate the file you just published from CatBase and double-click on it
- The data is imported and the tables created. Mine looks like this:
That's not bad, but it's kind of ... industrial-looking. I want to jazz it up a bit. The first thing I'd like to do is make a look a bit less boxy by changing the weight of the row and column strokes. This is done in the Cell Styles tab of the Table Styles palette in InDesign. I created a Cell Style called table details, selected a 0.5 weight for the cell stroke weight, and selected this cell style as the body rows cell style in the Table style.
I'd also like to make some changes to the way the prices are displayed. Currently, they are aligned left, but I want them to be aligned right. So I created a new paragraph stylesheet called "tabular-right" in InDesign and also created one with the same name in CatBase. I'd also like to see the pricing columns with coloured backgrounds: let's say light green for the Price Framed and light blue for Price Unframed.
Back to CatBase, then, and open up the Publishing Style Sheet.
- Open up the Paragraph that contains the table relation
- Open the Relation Element and open the Paragraph within that relation. This shows us the list of four Elements that comprise the table.
- Open the third Element - Price Unframed - and click on the Tables tab.
- Choose Light Green for the Cell Fill Colour (colours are created by going to Style Sheets->Colours on the main window)
- Choose tabular-right for the cell style sheet:
- Save that Element
- Make similar changes to the Price Unframed element, but choose Light Blue instead of Light Green for the Cell Fill Colour
- Save those changes
- Re-publish the data and import it into our InDesign layout
- The tables now look like this:
That's better! One more little tweak, I think ... the column headers should be the same colour as the columns. This is easy to fix:
- Back to CatBase again!
- Open up the Table Style that we're using
- Click on the InDesign tab
- Click on the Headers/Footers tab
- Under Background Colour, select the Same colour as data cells radio button
- Save the Table Style
- Re-publish the data
- The tables now look like this:

Summary
As you can see, there are lots of ways that you can design your tables with CatBase! If you have a particular requirement that you are not sure how to achieve, send an example to support@catbase.com and we will be pleased to evaluate it and let you know how it can be done (or if it can't).


