- Tables
- Creating a Table
- Editing Tables
- Table Shortcuts
- Formatting Tables
- Table and Cell Styles
Editing Tables
Once you’ve created a table, you can’t just sit and admire it (as tempting as that might be for longtime page layout users); you’ve got to do something with it.
Before we talk about that, though, we’d better lay down a few ground rules about cells, rows, and columns.
- A column is always the width of the widest cell in the column. When you change the width of a cell, you’re really changing the width of the column containing the cell.
- A row is always the height of the tallest cell in the row. Just as changing the width of a cell changes the width of a column, so altering the height of a cell changes the height of a row.
- In spite of the above restrictions, you can create tables containing cells that are wider than their parent columns or taller than their parent rows. You do this by merging cells, which we’ll discuss later, in “Merging Cells.”
Selecting and Editing Table Items
To select elements in a table, or to edit a table’s content (text, rows, or columns), click the Type tool in one of the cells of the table. This activates InDesign’s table tools. Once you’ve done this, you can enter and edit text in the cell, paste or place text or graphics in the cell, or even create another table inside the cell.
It’s easy to tell when you’re in this mode, because the cursor changes shape as you position it above cell, row, column, and table boundaries. What do these different cursors mean? What can you do with these tools? To find out, take a look at Table 6-1.
Table 6-1: Table Editing Cursors
When you see: |
Your cursor is: |
And you can: |
Above the top-left corner of the table |
Click to select the table. |
|
|
Above the left edge of a row |
Click to select the row. |
|
Above the top of a column |
Click to select the column. |
|
Above the right or left edge of a cell |
Drag to resize the column containing the cell. |
|
Above the top or bottom of a cell |
Drag to resize the row containing the cell. |
In addition, the Context menu changes to display options related to working with tables (see Figure 6-10).
Figure 6.10 Context Menu Options for Working with Tables
To select a range of cells, drag the text cursor through them. You cannot select non-contiguous cells. Note that dragging the cursor through multiple cells selects all of the text in the cells, regardless of the starting or ending position of the cursor.
To select a row, position the cursor above the left edge of the first cell in the row, then click; for a column, move the cursor above the top of the first cell in the column, then click (see Figure 6-11).
Figure 6.11 Selecting Rows and Columns
You select text inside a table cell using the same methods you use to select text in a text frame: Use the Type tool.
Entering Tab Characters
How the heck can you enter a tab character in a table cell? When you press Tab, InDesign moves the cursor to the next cell in the table (see “Table Shortcuts,” later in this chapter). If the cursor is in the last cell of the table, pressing Tab creates a new table row. Either way, you don’t get the character you’re looking for.
To enter a tab character, choose Tab from the Other submenu in the Insert Special Character submenu of the Context menu (or, if you’re using the Mac OS, press Option-Tab).
Pasting Data Into Tables
You can paste data into a table, but before you choose Paste from the Edit menu (or press Command-V/Ctrl-V) pay attention to what’s selected. If the text cursor is flashing inside a cell when you paste, InDesign pastes all the data into that one cell. If you select the cell itself (press Esc to toggle between selecting what’s inside the cell and the cell itself), and if the data you’re pasting has tabs or carriage returns in it, InDesign maps the clipboard data across more than one cell. If you need to update the data from an Excel document that you’ve turned into an InDesign table, you can copy the cells in Excel, switch to InDesign, select one or more cells in your table, and paste.
Placing a Graphic in a Table Cell
You place a graphic in a table cell in exactly the same fashion as you insert a graphic in text: click the Type tool in a cell, or select some text inside a cell, then place a file or paste a graphic you copied to the Clipboard earlier (see Figure 6-12). Note that you must select text or have an active text insertion point; selecting the cell itself will not get the graphic into the cell.
Figure 6.12 Placing a Graphic in a Cell
If you want the graphic to fill the entire cell, make sure the Cell Insets values are set to zero and the Clip Contents to Cell checkbox is turned on in the Cell Options dialog box (see “Formatting Tables,” later in this chapter).
Table Controls in the Control Panel
Some of the controls in the Table panel can also be found in the Control panel. You won’t see these controls unless you select a table item—a cell, a row, a column, or a table—when you select text in a table, the Control panel displays text formatting options.
In most of the table-related illustrations in this chapter, we’ll show the Table panel, rather than the Control panel, because the Control panel’s width makes it difficult to fit into our page layout. This doesn’t mean that we prefer the Table panel—in fact, we use the Control panel whenever the options we need are available there.
Adding Table Headers and Footers
InDesign tables can include header and footer rows, which can repeat as the table breaks across text frames, text columns, or pages. You can add header and footer rows when you create the table, or you can add them to existing tables, or you can convert table body rows to header or footer rows.
- If you’re using the Insert Table command to create a table, you can use the Header Rows and Footer Rows fields in the Insert Table dialog box to specify the number of header or footer rows as you create the table.
- If you want to add header and/or footer rows to an existing table, select a cell in the table (or a row, or a column, or the table itself) and choose Headers and Footers from the Table Options submenu of the Context menu. InDesign displays the Headers and Footers panel of the Table Options dialog box. Enter the number of header and/or footer rows you want, specify the repeat properties of the header/footer rows, and click OK (see Figure 6-13).
- To convert an existing row to a header row, select the row (it must be the first row in the table) and choose Convert to Header Rows from the Context menu (see Figure 6-14). To convert multiple table body rows to header rows, select the rows—the first row in the table must be included in the selection (if it’s not, the option won’t appear on the Context menu). Converting a row to a footer row works the same way—select the last row in the table and choose Convert to Footer Rows from the Context menu.
Figure 6.13 Adding a Header Row
Figure 6.14 Converting a Table Body Row into a Header Row
Editing Header and Footer Rows
The first header and footer rows can be edited just as you’d edit any other row—the only difference is that the changes that you make are applied to all instances of the header or footer throughout the table. Subsequent header/footer rows, however, will defy your efforts to get the cursor into them (InDesign coyly displays a lock icon when you move the cursor over the row).
InDesign provides a pair of shortcuts, however, that will take you back to the first header or footer row—Edit Header and Edit Footer on the Context menu.
Changing the Size of a Table
To resize a table by dragging, follow these steps (see Figure 6-15).
Figure 6.15 Resizing a Table
- Click the Type tool inside the table.
- Move the cursor over the left or right edge of the table (to change the table’s width), or over the top or bottom of the table (to change its height). Position the cursor above the lower-right corner of the table to resize the width and height of the table.
- Drag the cursor to resize the table. Or—better—hold down Shift as you drag to resize all the rows or columns an equal amount.
When you resize the table by dragging the lower-right corner of the table, or when you hold down Shift as you drag, InDesign applies the changes in size equally to all of the cells in the table. If you drag the sides of the table without holding down Shift, InDesign only changes the row or column nearest the edge you’re dragging. Resizing the table this way does not scale the text in the table.
What? You’ve resized the table and now want all of the columns to be the same width? Don’t start dragging columns around. Instead, select the table and choose Distribute Columns Evenly from the Table panel menu or Table menu (see Figure 6-16). If you’ve changed the height of the table and want to make all of the rows in the table the same height, select the table and choose Distribute Rows Evenly (again, from the Table menu or from the Table panel menu).
Figure 6.16 Distributing Columns Evenly
Changing the Size of Rows and Columns
To change the height of a row or the width of a column by dragging, follow these steps (see Figure 6-17).
Figure 6.17 Changing Row Height by Dragging
- Click the Type tool inside a cell.
- Move the cursor over the top or bottom of the cell to change the height of the row containing the cell, or over the left or right of the cell to change the column width.
- Drag the cursor up or down to resize a row, or right or left to resize a column.
To change the height of a row or the width of a column using the Table panel, follow these steps (see Figure 6-18).
Figure 6.18 Changing Column Width Using the Table Panel
- Click the Type tool inside a cell.
- Adjust the values in the Row Height and Column Width fields (you can type values in the fields, or use the arrow buttons associated with the fields to “nudge” the height or width up or down).
To change the height of a row or the width of a column using the Cell Options dialog box follow these steps (see Figure 6-19).
Figure 6.19 Changing Column Width Using the Cell Options Dialog Box
- Select a cell, a row, a column, or the entire table.
- Choose Rows and Columns from the Cell Options submenu of the Context menu (or from the Table menu). InDesign displays the Cell Options dialog box.
- Enter a new value in the Row Height field to change the height of the row, or in the Column Width field to change the width of a column.
Adding Rows Or Columns
If you’re entering text in a table, and have reached the cell of the last row, you can add a row by simply pressing Tab—InDesign assumes that this means that you want to add a row to the table. If you need to add rows inside an existing table, it’s a little bit more complicated.
To add a row or a series of rows to a table, follow these steps (see Figure 6-20).
Figure 6.20 Adding Rows
- Click the Type tool in a cell in a row that is above or below the point at which you want to add the new rows.
- Choose Row from the Insert submenu of the Table or Context menu. InDesign displays the Insert Row(s) dialog box.
- Enter the number of Rows you want to add in the Number field, and choose the Above or Below option to tell InDesign where to put the rows (relative to the selected row).
- Click the OK button. InDesign adds the empty rows.
To add a column or a series of columns to a table, follow these steps (see Figure 6-21).
Figure 6.21 Adding a Column
- Click the Type tool in a cell in a column that is adjacent to the point at which you want to add the new columns.
- Choose Column from the Insert submenu of the Context menu. InDesign displays the Insert Column(s) dialog box.
- Enter the number of Columns you want to add in the Number field, then choose the Left or Right option to tell InDesign where to put the rows (relative to the selected row).
- Click the OK button. InDesign adds the empty columns.
You can also add a row or column by dragging. To do so, follow these steps (see Figure 6-22).
Figure 6.22 Adding a Column by Dragging
- Click the Type tool in a cell.
- To add a column, position the cursor over the left or right side of the cell; to add a row, position it above the top or bottom.
- Hold down the mouse button, then press Option/Alt and drag. InDesign adds a row or column to the table.
To add a row to a table using the Table panel, follow these steps (see Figure 6-23).
Figure 6.23 Adding a Row Using the Table Panel
- Click the Type tool in a cell.
- Display the Table panel (press Shift-F9[1]), then change the value displayed in the Rows field or the Columns field.
When you add a row using this technique, the new row appears below the row you selected; when you add a column, the new column appears to the right of the selected column.
Deleting Rows, Columns, and Tables
To delete a single row, click the Type tool in a cell in the row, then choose Row from the Delete submenu of the Context menu. There’s no need to select the row or cell. To delete more than one row, select at least one cell in each row you want to delete, then choose Row from the Delete submenu of the Context menu.
To delete a single column, click the Type tool in a cell in the column, then choose Column from the Delete submenu of the Table or Context menu. To delete more than one column, select a cell in each column you want to delete, then choose Column from the Delete submenu of the Context menu.
To delete a table, click the Type tool in any cell in the table, and then choose Table from the Delete submenu of the Table menu or the Context menu. InDesign deletes the entire table containing the cell.
You can use the Type tool to select the character containing the table (though it can be a very large character, it’s still a single character), or place the cursor after the table in the story, and press Delete.
To delete rows or columns using the Table panel, follow these steps (see Figure 6-24).
Figure 6.24 Deleting a Column Using the Table Panel
- Click the Type tool in a cell.
- Display the Table panel (press Shift-F9) if it isn’t already visible, then reduce the value in either the Rows field or the Columns field. InDesign asks if you’re certain you want to remove the row(s). You are certain, so click the OK button.
Merging and Unmerging Table Cells
To merge a series of selected table cells into a single cell, select the cells and choose Merge Cells from the Context menu or Table menu (see Figure 6-25). The text and graphics in the selected cells are placed in the new merged cell.
Figure 6.25 Merging Cells
To unmerge a cell that has been created by merging cells, select the cell and choose Unmerge Cells from the Context menu or Table menu. Note that unmerging a merged cell is very different from splitting the cell, which only divides the cell in half along its horizontal or vertical axis. Unmerging a cell actually returns the cells in the merged cell to their original geometry, though it does not restore their original content.
Splitting Table Cells
To split a cell, select the cell and choose Split Cell Horizontally or Split Cell Vertically from the Context menu (see Figure 6-26).
Figure 6.26 Splitting a Cell
Rotating Table Cells
Cells in an InDesign table can be rotated in 90-degree increments (see Figure 6-27). To rotate a cell, select the cell and then choose one of the options (0, 90, 180, 270) on the Rotate submenu of the Context menu (or click the corresponding button in the Table panel).
Figure 6.27 Rotating a Cell
Using a Table to Create a Box Around a Paragraph
Sometimes, you need to place a box around a paragraph—you often see this formatting used to set off notes and warnings in technical manuals. While you could always draw a box behind the paragraph, you would then have to move the box when the paragraph changes its position on the page due to text editing or layout changes.
We know of other methods for accomplishing this (involving paragraph rules and inline frames)—but the best way to put a box around a paragraph is to convert the paragraph to a single-cell table. We do not know if single-cell tables can reproduce by fission, as other single-cell animals can, but they’re certainly useful nonetheless.
To convert a paragraph to a single-cell table, select all of the text in the paragraph up to, but not including, the return at the end of the paragraph. Then choose Convert Text to Table from the Table menu (see Figure 6-28). Apply whatever formatting you want to the fill and stroke of the table’s single cell.
Figure 6.28 Placing a Box Around a Paragraph