InDesign tip : #31

the last couple of scripting lessons (#30 & #31) showed a couple of examples of how to use applescript to assist with reformatting an existing table. but if you are setting up your own tables you’d use table and cell styles to make your life a little easier.

as with paragraph, character and object styles — if you are going to use particular formatting settings more than once in a document, it’s smart to create a style for those settings. so, if your document has several tables with similar formatting, you’d create a table style. this example only has one table, so we’ll just look at cell styles.

when we first change our text to a table it will look something like this :
screen grab of unformatted table

then we start to create the table formatting we want :
screen grab of partially formatted table

to create the cell style for the reversed row, highlight that row and then choose “New Cell Style…” from the flyout menu on the cell styles panel (windows > styles > cell styles) :
screen grab of cell styles panel flyout menu

you can also access this functionality directly from your control panel :
screen grab of cell styles menu in control panel

the new style takes on the formatting of the selected cells. we’re calling that style ‘header row’ and you can see that, as well as the colour of the cells, the cell style will also apply a paragraph style to the text in those cells. that is, the paragraph style does not need to be applied separately — it’s part of the cell style :
table15

then repeat the process for each different cell type. for this table we’ve created three different cell styles :
screen grab of new styles in cell styles panel

the easiest way to proceed from here is to first apply the most common style to the entire table. to select every cell in a table, first place your cursor somewhere within the table and then move your mouse to the top left corner of the table until you see a downward pointing arrow, then click.

here we’ve applied the ‘basic row’ style to the entire table by clicking that style in the cell styles panel (or from the control panel dropdown) :
screen grab showing entire table with bsaic row style applied

then go through and apply the other styles to their relevant cells (here we’re doing entire rows in the same style) :
screen grab of table with complete formatting

now here’s why you’ve gone to all that trouble … when the client comes back and says they want all the reversed rows to be thicker and all the blank rows to be thinner (or any of a gazillion other possible alterations), you don’t have to change each row individually (or use applescript) you just change the cell styles. unfortunately InDesign does not yet allow you to specify a specific cell height in the cell style (who knows why), but you CAN change the spacing — or cell insets. here we’re changing the top and bottom insets for the ‘header row’ style from 1mm to 2mm :
screen grab showing cell style options for the header row style

and like magic the entire table is updated automatically :
table13

so, if you’re working with tables but not using cell styles, you’re probably working way too hard.

macgrunt icon

thoughtful and respectful comments welcome

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s