Tables

Writer gives you a lot of flexibility for inserting tables and formatting tables. Perhaps the most powerful table feature is the ability to perform basic calculations in cells , and to create charts based on table contents.

Note

For information on creating charts, see Charts on page 290. To quickly insert data from a data source as a table, see Inserting Data Sources as Plain Text in a Table on page 382.


Inserting a Quick Table

This method of inserting a table gives you only a basic table with a single-line border around all cells. If you want to insert a table with more formatting, see the next procedure.

  1. Click the location in the document where you want to insert the table.

  2. Click and hold the Insert tool on the toolbar.

    graphics/08inf05.jpg

  3. Click the Insert Table tool. A small grid is displayed below the Insert Table tool.

  4. Move the pointer through the grid and select the number of rows and columns you want the table to be. The grid expands as you move the pointer into its borders, and the table dimensions display at the bottom of the grid.

The row count includes a table header row and borders by default. If you want to change these and other defaults, choose Tools > Options > Text document > Insert, or Tools > Options > Text document > Table.

Inserting and Formatting a Table

You can also insert tables while controlling its appearance.

  1. Choose Insert > Table.

  2. In the Insert Table window, enter a table name. The table name is used to identify the table when Navigator is used.

  3. Set the number of columns and rows, and set the header options. To apply preset formatting to the table, click the AutoFormat button.

  4. In the AutoFormat window, click the More button.

  5. Set the elements you want to AutoFormat. Figure 8-5 and Figure 8-6 describe options in the Insert Table and AutoFormat windows .

    Figure 8-5. Inserting a table

    graphics/08fig05.jpg

    Figure 8-6. Applying a predefined AutoFormat

    graphics/08fig06.jpg

Note

If your table runs to the bottom of the page and disappears, deselect the Don't Split option. If that doesn't work, try deselecting the Repeat Header option as well.


Making the Table Heading Repeat

See Figure 8-5 and be sure the Header and Repeat Header options are marked .

Joining Two Tables

  1. You must put the tables right next to each other as shown below.

    graphics/08inf06.gif

  2. Put the cursor in a cell in one of the fields. Right-click and choose Merge Tables.

Setting Up How Tables Are Created By Default

Before you begin, complete table setup options. If you're having problems with tables, it's probably because of a setting that's doing stuff you don't expect. See Figure 8-7.

Figure 8-7. Setting table options

graphics/08fig07.jpg

Creating Nested Tables

You've got a table, but how do you put a table inside another table? If you put the cursor inside a table cell and choose Insert > Table, the table window pops up but on the Background tab. The ability to insert another table is grayed out. So you can fool the program into thinking you're not in a table by inserting a frame in that cell, then putting the nested table inside that frame.

  1. Choose Tools > Options > Load/Save > HTML Compatibility.

  2. Be sure Netscape 4.x is selected as the export format. Click OK.

  3. In an HTML document, choose Insert > Table and make the first table the way you want it. This is the top table; you'll create the table inside it in the following steps.

  4. Click inside the cell where you want to add the nested table.

  5. Choose Insert > Frame. The frame will appear in the cell as shown in Figure 8-8.

    Figure 8-8. Inserting a frame in a table to hold the nested table

    graphics/08fig08.jpg

  6. Click in the frame as shown at right.

    graphics/08inf07.gif

  7. Choose Insert > Table and create the inner table as shown in Figure 8-8.

    Figure 8-9. Inserting the nested table in the main table

    graphics/08fig09.jpg

  8. Format the tables as you want them.as shown in Figure 8-8.

Figure 8-10. Formatting main and nested table

graphics/08fig10.jpg

Using the Table Formatting and Modifying Tools on the Object Bar

When you click inside a table, the object bar changes to show the table formatting tools in Figure 8-11.

Figure 8-11. The object bar when the cursor is in a table

graphics/08fig11.jpg

To switch back to the text formatting tools in the object bar, click the large left-pointing arrow at the right side of the object bar.

graphics/08inf08.jpg

If you simply want to apply (or remove) bold, italicize, or underline table text formatting, use the following keyboard shortcuts instead of switching to the text formatting object bar.

Bold Ctrl+B

Italic Ctrl+I

Underline Ctrl+U

You can use these shortcuts in combination with each other to make selected text bold italic , for example.

Repeating One or More Heading Rows

The first row of a table is always the header row, whether or not you apply some kind of a table heading paragraph format to it. To make the header row repeat when the table breaks to a new page:

  1. Click in the table, right-click, and choose Table.

  2. In the Text Flow tab, select the Repeat heading option.

  3. Click OK.

If you want more than one heading row to repeat, select the cells in the heading and choose Format > Cell > Split. Then, in the Split Cells window, set the number of rows you want the heading row to be, select the Horizontally option, and click OK.

Controlling How Tables Break Over Pages

There are three windows with options that determine how tables break when they hit a page break. The Do Not Split or Don't Split Table selection, if marked, means that Writer tries to keep your table on one page. With a 3-page table, this can cause problems. You probably want it unmarked everywhere.

  1. Choose Format > Table and click the Text Flow tab (Figure 8-15 on page 285).

    Figure 8-15. The Table Format window, Borders tab

    graphics/08fig15.jpg

  2. Choose Tools > Options > Text Document > Table (Figure 8-7 on page 279). This window controls how tables are inserted by default.

  3. When you're inserting a table via Insert > Table, you'll see the top window in Figure 8-5 on page 278.

General Table Formatting

Use this procedure for more overall table formatting, such as changing table width, alignment, space above and below the table in the document, determining whether the table breaks to a new column or page or whether the heading repeats, and tweaking table borders and background.

You need to have a table created before any of the menu choices will be available.

For quick border and background color formatting, use the object bar.

  1. Click in the table. If you want to change specific cell borders or background, select the cells you want to modify.

  2. Right-click and choose Table.

  3. You can also choose Format > Table.

  4. Make modifications to the table in the Table Format window.

Use Figure 8-12 through Figure 8-16 for guidance.

Figure 8-12. The Table Format window, Table tab

graphics/08fig12.jpg

Figure 8-16. The Table Format window, Background tab

graphics/08fig16.jpg

Figure 8-13. The Table Format window, Text Flow tab

graphics/08fig13.jpg

Figure 8-14. The Table Format window, Columns tab

graphics/08fig14.jpg

Protecting Cell Contents

You can keep the contents of certain cells from being edited directly by protecting them, effectively making them read-only.

  1. Select the cells you want to protect.

  2. Right-click, and choose Cell > Protect.

To make a cell writable again, select it, right-click, and choose Cell > Unprotect.

Number Formatting in Cells

You can assign different number formats to specific cells, so that when you type in a value or perform a calculation, the value automatically becomes a dollar amount, a percentage, a date, or whichever format you've chosen .

Changing Number Formatting

You can also change number-formatted cells back to regular text format using this procedure.

  1. Select the cell(s) you want to format.

  2. Right-click and choose Number Format. You can also choose Format > Number Format.

  3. Select a numbering format category and set options for it. Use Figure 8-17 for guidance.

    Figure 8-17. Setting number format options

    graphics/08fig17.jpg

  4. Click OK.

Creating Your Own Number Formats

There's a huge list of formats in the number format window in Figure 8-17. However, if you need to make your own, you can do that too.

The number format codes can consist of up to three sections separated by a semicolon (;).

  • If the code has two sections, the first represents positive values and zero, and the second negative values.

  • If a code has three sections, the first is for positive values, the second for negative values and the third for zero.

  • You can also define conditions yourself, in this case you can make the first section of hits dependent on the first condition, the second section dependent on the second condition and the third section will only be run if the first two conditions do not apply.

See the Help for information on doing this; it's got lots of great information and examples.

Tweaking Tables Once You've Created Them

Who inserts a table just the way they want it? Here's how to quickly change what's there, or insert or delete rows and columns.

Changing Column Widths Using the Table Formatting Bar

Position the mouse pointer on top of a table cell border. When the pointer changes to a double arrow, click and drag to the new width.

graphics/08inf09.gif

Making Column Widths Equal Using the Table Formatting Bar
  1. Select the columns you want to make equal widths.

  2. In the object bar (which now shows table tools), click and hold down the Optimize button, then click the Space Columns Equally button.

    graphics/08inf10.jpg

You can change the default column width used when you insert a table. Choose Tools > Options > Text document > Table, and make the change in the Insert area of the Options window.

For more precise control over column and table width, see General Table Formatting on page 283.

Inserting Columns and Rows

You can insert rows and columns into a table after you've already created it.

  1. Click in a row or column next to where you want to make the insertion.

    The new rows or columns you insert will share the same formatting as the selected row or column.

  2. Right-click, and choose Row > Insert, or Column > Insert. (There are also Insert Row and Insert Column buttons on the object bar.)

  3. In the Insert window, set the number of rows or columns you want to insert, and designate whether you want to insert them before or after the selected area in the table.

  4. Click OK.

To adjust the default column widths when columns are inserted, choose Tools > Options > Text document > Table, and make the adjustment in the Insert section of the Options window.

Deleting Columns, Rows, and Entire Tables
  1. Select the first cell(s) in the row(s) or column(s) you want to delete.

  2. Right-click the selection and choose Row > Delete, or Column > Delete.

    There are also Delete Row and Delete Column buttons on the object bar.

Be careful when you delete columns and rows. If you select a column for deletion, but you right-click and choose Row > Delete, all selected rows are deleted rather than the column. That means if you select an entire column, you will delete the entire table by right-clicking and choosing Rows > Delete.

Changing Row Height

You can change the space between cell text and top and bottom of the cell by changing the row height. Increasing the row height also lets you to see the effects of the vertical alignment of the cell contents.

  1. Select the rows you want to change.

  2. Right-click and choose Row > Height. You can also choose Format > Row > Height.

  3. In the Row Height window, set the new size.

  4. Select the Fit to size option if you want the row height to adjust automatically with the amount and size of text entered.

Changing Vertical Alignment

When you increase the space above and below cell text by increasing the row height, you can vertically align the text to display at the top, middle, or bottom of the cell. To do this, select the cells you want to align, right-click, and choose Cell > (Top, Center, or Bottom).

Figure 8-18. Vertical alignments

graphics/08fig18.jpg

Merging and Splitting Cells

You can merge multiple cells so that they become a single cell, and you can split a single cell into multiple cells.

  1. Select the cells you want to merge or split.

  2. Click the Merge or Split button on the object bar, or right-click and choose Cell > (Merge or Split).

Quickly Making a Chart From the Data in Your Table

Select the table and choose Insert > Object Chart. The AutoPilot will guide you through and you'll have a chart based on your table data before you know what's happened to you.

See page 590 for more information.



OpenOffice. org 1.0 Resource Kit
OpenOffice.Org 1.0 Resource Kit
ISBN: 0131407457
EAN: 2147483647
Year: 2005
Pages: 407

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net