Additional table operations

From Apache OpenOffice Wiki
Jump to: navigation, search


Adding a caption

You can easily add a caption to any table. Writer will keep track of all your captioned tables, automatically number them, and update any links to them.

To add a caption to a table:

  1. Place the cursor in the table.
  2. Right-click and select Caption from the pop-up menu. Alternatively, the Insert > Caption menu option becomes available whenever your cursor is inside a table cell.
  3. Enter the text for your caption, your category selection, the numbering style, separator, and position (above or below the table).
  4. Click OK.

Template:Documentation/Note

Writer supplies five different category labels for captions: <None>, Drawing, Table, Illustration, and Text.

You can also create your own category labels, formating, and separators. For example, you might want your tables to be labeled as Fantasia, formatted with roman numerals, and using a period (‘.’) as a separator, as follows:

Fantasia I. Interesting data

Fantasia II. More interesting data

Fantasia III. Yet more interesting data

To accomplish this:

  1. Open the Caption dialog box following the instructions above.
  2. In the Category field, select the text and type the word Fantasia.
  3. In the Numbering drop-down, select the Roman (I II III) option.
  4. In the Separator field, select the text and type a period (.) followed by a space.

Template:Documentation/Note

Additional options for numbering captions by chapter are available under the Options button in the Captions dialog box. Some of these settings which refer to the outline level will only have an effect if you are using outline level paragraph styles on the chapter headings within your document. See Chapter 7 (Working With Styles) for information.

By adding chapter numbers to your captions, OOo will restart the caption numbering for each chapter it encounters. For example, if the last figure caption you create in chapter 1 is Figure 1.15, and the next figure caption you create is in chapter 2, the numbering will start over at Figure 2.1.

Options available to chapter numbering for captions include the following:

  • Use Level to specify the outline levels that triggers a restart of the numbering as well as how many levels of outline numbering are shown before the table number. An example may be useful. Suppose your document uses Heading 1 style for chapters and Heading 2 style for sub-headings, and that this is how you set up your outline numbering. If you want all the tables in a chapter (that is, between two Heading 1 paragraphs) to be numbered sequentially independently of the sub heading they are under, select 1 as Level. If instead you want to restart the numbering at each sub-heading select level 2.
  • Use the Separator field to establish the separator between the chapter number and figure number.
  • Use Character style to set a character style for the caption. This is useful if the separator of your choice is not a symbol included in the default font type of your document or if you want the caption to have a special color, size and so on.
  • The Apply border and shadow option does not apply to table captions. OOo normally wraps the objects you can add a caption to in a frame, but not for tables.
  • Use Caption order to specify whether you want the category or numbering to appear first in the caption.

All of the features described above can also be set up to automatically apply to any new tables you create in your document.

To automatically caption all your tables:

  1. Place the cursor in a table.
  2. Right-click and select Caption from the pop-up menu.
  3. Select AutoCaption.
  4. Select OpenOffice.org Writer Table and select the settings you want and click OK. This dialog box is covered in more detail in Chapter 2 (Setting up Writer).

When AutoCaption is enabled for tables, any new tables will be captioned according to your selections in the AutoCaption dialog box; however, you will need to add the specific text for each caption onto the table manually.

Cross‑referencing a table

You can insert a cross‑reference to a captioned table. Clicking on the cross-reference takes the reader directly to the table.

  1. Position the cursor where you want the cross reference.
  2. Select Insert > Cross-reference from the main menu.
  3. Set the Type to Table. A list of captioned tables will be shown in the Selection panel; select the one you want to reference.
  4. In the Format pane, choose how the cross reference will appear.
    • Page creates a reference of the page number that the caption appears on.
    • Chapter places a reference to the chapter number in which the caption appears. This will only produce an empty space unless you have setup your chapter headings with outline level paragraph styles.
    • Reference inserts the entire caption's category, number and caption text as a reference.
    • Above/Below inserts “above” or “below” depending on whether the table appears above or below the cross-reference.
    • As Page Style creates a reference of the page number that the caption appears on using the page style format.
    • Category and Number creates a cross-reference with only the caption's category and number; for example, Table 1 for the first table.
    • Caption Text creates the reference using the caption text, leaving off the category and number.
    • Numbering inserts only the number of the caption.
  5. Click Insert to add the cross-reference and click Close to exit the dialog box.

Automatic formatting of tables

AutoFormat is a functionality whereby you can apply an elaborate formatting to your table with just a few clicks. AutoFormat is somewhat similar to paragraph styles and will enable you to obtain consistent looking tables across your document. You can also create your own table formats and save them as another AutoFormat option.

To apply an AutoFormat, place the cursor anywhere in the table and select Table > AutoFormat. This opens the dialog box shown in Figure 11.

Select from the list on the left the Format most suitable for your table and click OK to apply it. Clicking the More button opens another section of the dialog box where you can rename the selected table format scheme as well as decide which parts of the predefined formatting you want to apply to your table. You can selectively apply the number format, the font, the alignment, the border, or the pattern.

The table AutoFormat dialog

To create your own AutoFormat, proceed as follows:

  1. Create a table and manually format it as you wish, including borders, spacing of text from the top and bottom borders, fonts to be used in the table heading and data cells, and background colors.
  2. Position the cursor anywhere in the table and then click Table > AutoFormat.
  3. On the AutoFormat dialog box above, click Add and give the table format a name in the Add AutoFormat dialog box and click OK.
  4. The newly named AutoFormat now appears as an available format. Click OK to close the AutoFormat dialog box.

Template:Documentation/Tip

Creating a heading row in an existing table

To create a heading row in an existing table that does not have one, you need to apply an AutoFormat that does have a heading defined. (Here is where having some personalized table formats could come in very handy.) Place the cursor anywhere in the table and then click Table > AutoFormat. Choose a format. Click OK. Use the More button and deselect the formatting options you do not want to apply to your table.

Merging and splitting tables

One table can be split into two tables, and two tables can be merged into a single table. Tables are split only horizontally (the rows above the split point are put into one table, and the rows below into another).

To split a table:

  1. Place the cursor in a cell which will be in the top row of the second table after the split (the table splits immediately above the cursor).
  2. Right-click and select Split Table in the pop-up menu. You can also use Table > Split Table from the menu bar.
  3. A Split Table dialog box pops up. You can select No heading or an alternative formatting for the heading—the top row(s) of the new table.
  4. The table is then split into two tables separated by a blank paragraph.

Template:Documentation/Note

To merge two tables:

  1. Delete the blank paragraph between the tables. You must use the Delete key (not the Backspace key) to do this.
  2. Select a cell in the second table.
  3. Right-click and select Merge Tables in the pop-up menu. You can also use Table > Merge Table from the menu bar.

Template:Documentation/Tip

Deleting a table

To delete a table:

  1. Click anywhere in the table.
  2. Select Table > Delete > Table from the main menu.

Or:

  1. Select from the end of the paragraph before the table to the start of the paragraph after the table.
  2. Press the Delete or the Backspace key.

Template:Documentation/Note

Copying a table

To copy a table from one part of the document and paste it into another part:

  1. Click anywhere in the table.
  2. From the main menu select Table > Select > Table.
  3. Press Control+C or click the Copy icon on the Standard toolbar.
  4. Move the cursor to the target position and click on it to fix the insertion point.
  5. Press Control+V or click the Paste icon in the Standard toolbar.

Moving a table

To move a table from one part of a document to another part:

  1. Click anywhere in the table.
  2. From the main menu, select Table > Select > Table.
  3. Press Control+X or click the Cut icon in the Standard toolbar. (This step removes the contents of the cells but leaves the empty cells, which must be removed in step 6.)
  4. Move the cursor to the target position and click on it to fix the insertion point.
  5. Press Control+V or click the Paste icon in the Standard toolbar.
  6. Return to the original table, click somewhere in it and then select Table > Delete > Table from the main menu.

Using tables as a page layout tool

Tables may be used as a page layout tool to position text in a document instead of using tabs or spaces. For example, Tips in the PDF version of this book are formatted as tables.

For more information and tips about using tables in page layout, see Chapter 4 (Formatting Pages).

Template:Documentation/Tip

Template:Documentation/Tip


Content on this page is licensed under the Creative Common Attribution 3.0 license (CC-BY).
Personal tools