0% found this document useful (0 votes)
27 views

Creating and Formatting Tables: in This Chapter

This document discusses formatting tables in Writer. It provides instructions on how to create and insert tables, add and delete rows and columns, apply borders and shading, and format tables. Spreadsheets are also mentioned as an alternative to tables for numerical data that can then be pasted into Writer documents. The document contains tips for basic table management and advanced formatting using different border styles, widths, and colors.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Creating and Formatting Tables: in This Chapter

This document discusses formatting tables in Writer. It provides instructions on how to create and insert tables, add and delete rows and columns, apply borders and shading, and format tables. Spreadsheets are also mentioned as an alternative to tables for numerical data that can then be pasted into Writer documents. The document contains tips for basic table management and advanced formatting using different border styles, widths, and colors.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

chapter

11

Creating and Formatting Tables

IN THIS CHAPTER

Using Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating Writer Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Formatting Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding and Managing Rows and Columns . . . . . . . . . . . . . . . . . . . . . . . . . . Creating and Applying AutoFormats: The Table Formatting Timesaver. . . . Converting Between Text and Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Automatic Number Formatting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sorting Data in a Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Doing Calculations in Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

page 178 page 178 page 182 page 189 page 193 page 195 page 198 page 199 page 201

177

178

Chapter 11 Creating and Formatting Tables

Using Tables
Sometimes you just need a document with standard text and pictures, one after another. You have a paragraph, a list, a picture, and so on. That ends pretty quickly when you get anything remotely complicated, or if you need to cram a lot of information onto a page. Its also time for a new approach if you want to be able to easily compare information side by side. Anytime you want to control visually where pieces of text go, when youve got lots of data to present in one spot, or if want to be able to do a little math with your numeric data, tables are a great idea. Its also a good idea to use tables when you have two columns of information that need to be side by side, and there are two or more rows in the first column.
Tables are good for straight-up financial figures, since you can easily compare the data, and you can apply automatic currency formatting. Tables let you arrange different pieces of information for particular topics, as shown. In this and the above example, you also see some options for shading and border formatting.

Tables are an excellent approach for information like the example at left. Just use a table, and take off the borders. You will drive yourself crazy if you try to do this with tabs or wrapping text.

Creating Writer Tables


Tables are pretty easy to insert and fiddle with. Use the Table menu, and all the features are right there. You get a special formatting bar for the table that has pretty much everything you need, and a toolbar that pops up to give other ways to access the features.

Creating Writer Tables

179

Inserting a Table
There are a couple approaches to inserting a table.

Creating a Table Using the Table Menu


1 2

Choose Insert > Table. In the Insert Table window, specify the number of columns and rows. (This includes the header row.) If you dont want a header, unmark it.

If you want to apply an Autoformat, click the Autoformat button and make your selection. (For more information, see Creating and Applying AutoFormats: The Table Formatting Timesaver on page 193.) Click OK. The table will appear in the document. Fill in the table as needed. You can press Tab to move from cell to cell (Shift + Tab to move back).

4 5 6

Creating a Table Using the Insert Menu or the Insert Table Icon
You can also insert a table by choosing Insert > Table. Another option is to display the Insert toolbar. Click and hold down on the Insert Table icon and select the number of rows and columns.

180

Chapter 11 Creating and Formatting Tables

Creating a Table With Multiple or No Heading Rows


1 2

Choose Insert > Table. In the Insert Table window, select or unmark the Heading option.

3 4 5

To have multiple heading rows, specify the number of heading rows; these rows will repeat on each page. Specify the number of standard rows and other options, as usual. Click OK.

Table Management Tips


Some aspects of tables are a bit tricky; heres how to do the basics.

Inserting a Blank Line at the Top of a Page Above a Table


Youve inserted a table at the top of a page, and now you want regular text above the table. To do this, click in the top left cell of the table, and press Return.

Separating Two Tables


Youve got two tables, one immediately on top of the other. You want regular text between them; what do you do? Its the same as inserting a blank line above a table. Click in the top left cell of the second table, and press Return.

Deleting Just the Contents of a Table


Select the table and press Delete. Only the content will disappear.

Creating Writer Tables

181

Deleting a Table
Heres one approach.
1

Select the first line above the table, as well as the entire table.

Press the Delete key on your keyboard. The table disappears.

Another approach is to select the whole table and click either the Delete Row or Delete Column icon.

Deleting Rows or Columns


Click in the row(s) or column(s) you want to delete. Then use the Delete Row or Delete Column icons shown previously, or right-click and choose Row > Delete or Column > Delete. And in yet another approach, you can choose Table > Delete > Rows or Table > Delete > Columns.

Skip the TablesUse a Spreadsheet


Spreadsheets are easier to use. Create the spreadsheet, then paste into Writer.
The spreadsheet looks like this when you paste it into Writer

Heres the spreadsheet in Calc.

The spreadsheet looks like this when you paste it into Writer, then double-click it.

182

Chapter 11 Creating and Formatting Tables

If youve got a lot of numeric data, or things that would be better done in a spreadsheet, then just do it in a spreadsheet. Then copy and paste the data into the Writer document. You can copy some or all of a spreadsheet. When you paste it into Writer, it looks just like plain data; any borders you apply will come over, but if there arent any borders, you dont see any. When you double-click in the spreadsheet data in Writer, then it looks like a spreadsheet.

Plain Pasting
Copy the part of the spreadsheet you want to copy, then go to the other document and choose Edit > Paste to simply paste the spreadsheet.

Linking to the Spreadsheet, for Automatic Updates


Copy the part of the spreadsheet you want, go to the other document, and choose Edit > Paste Special. In the Paste Special window, select DDE Link. Click OK.

That means the pasted information will be updated every time you change the data in the spreadsheet. This is particularly nice if you need data from a spreadsheet to be included in several different documents. This works when you paste from a spreadsheet into a Writer document, and when you paste from a spreadsheet into another spreadsheet.

Formatting Tables
You can format many aspects of a tablethe background, borders, border styles, and so on. Theres a specific toolbar, the Table toolbar, that helps you do much of that.

Viewing the Table Formatting Bar


When you create a table, there are a bunch of table-specific things youll want to do: apply borders, add and remove rows and columns, etc. To help you do these things more easily, OpenOffice.org provides a specialized table toolbar with these tools.
1 2

Click in a table. Be sure that the Table toolbar appears. If it doesnt, choose View > Toolbars > Table.

Formatting Tables

183

Adding or Removing Table Borders


Table borders are good for making tables more legible. You can also remove table borders using these steps, if you want to use the approach described in Using Tables, Not Tabs, for Parallel Columns of Text on page 145.
1

Open the table to apply borders to.

Be sure you can see the table formatting toolbar. Refer to Viewing the Table Formatting Bar on page 182 if you dont see it.

Click on the borders icon and hold your mouse down on it. Select the blank option, to clear the current borders, before you apply other borders.

Whenever you switch where the borders are placed, you have to clear the old borders first by selecting the blank option. Then select a new border placement option.

184

Chapter 11 Creating and Formatting Tables

With the table still selected, click and hold down the mouse again on the borders icon and select the icon for the formatting you want.

The table will show the new border placement.

Applying Different Border Styles


You can set off or distinguish certain lines, such as the heading row, in your table using different types of borders, such as double lines or single lines.

1 2

Select the table to change line styles for. Be sure the table toolbar is displayed.

Formatting Tables

185

Click and hold down your mouse on the Border Style icon.

4 5

Select a border type you want. The table will reflect the change.

Changing the Border Color


This is very similar to the other procedures. Just select the table and use the line color icon on the table toolbar.

186

Chapter 11 Creating and Formatting Tables

Applying Background Shading


Background shading is another good way to highlight information in a table or make a table with lots of columns or rows more readable.

1 2

Select the table, and be sure you can see the table formatting bar. Click and hold down the mouse on the Background icon.

3 4

Select a color. The table will reflect the change.

Formatting Tables

187

Advanced Reference to Borders and Shading


Lets say you want a table that looks like this. There are different border widths, border styles, and though it doesnt show in the printed version of the book, different colors, on various lines within the table.

Very few people would, of course, since its not that attractive. But the point is, how do you apply specific border formatting to each border in a table? To have more control over border formatting, youll want to use the Table Format window. Select the table and choose Table > Table Properties.

Borders Tab
You can use the presets but you can also click on each line in the border area. Clicking on a line in the User-Defined border area will switch it from selected to deselected
Give the text some spacing using these fields. Specify the border style and color here, for the currently selected line in the User-Defined field, or for the selected Default borders.

Click on a line in the UserDefined area, then select color, style, and other options.

Specify the shadow, direction, and distance from the border, here. The shadow is for the whole table, not per line.

188

Chapter 11 Creating and Formatting Tables

When you select a line in the User-Defined area, or when you choose a preset Default pattern, heres what it translates into in a table.
Only the top border

Only the far-left border All interior vertical borders Only the far-right border

Only the bottom border

All interior horizontal borders

What about Merge Adjacent Line Styles? This option in the Borders tab merges two different

border styles of adjacent cells in a Writer table into one border style. This property is valid for a whole table in a Writer document. The rules can be condensed to the statement that the stronger attribute wins. If, for example, one cell has a red border of 2 point width, and the adjacent cell has a blue border of 3 point width, then the common border between these two cells will be blue with 3 point width.

Background Tab
This doesnt provide all that much additional value, but you can apply the formatting to the cell, row, or whole table. You can also choose a background color or background graphic for the cell, row, or table

Adding and Managing Rows and Columns

189

Adding and Managing Rows and Columns


Once youve got the formatting down and you start entering information in the table, youll probably find that you dont have enough rows, or you have too many columns heres how to hand thatand as usual, the Table toolbar has the tools you need.

Adding and Deleting Rows and Columns


1 2

Be sure you can see table toolbar; if you cant, choose View > Toolbars > Table. Click in the row above where you want a new row.

Click the Insert Row icon

Click in the row you want to delete, or select rows to delete, and click the horizontal icon.

Changing Column Width


You can use the Table Format window to change column width, or drag the borders.

Dragging the Column Borders


1

Select the entire table and position your cursor over the line on the ruler where you want to change the width of a column. Make sure the cursor turns into a two-ended arrow, as shown.

190

Chapter 11 Creating and Formatting Tables

Drag the column separator to the left or right to change the width.

This will also work if you move your mouse over the table itself; when the icon looks like this, drag the border left or right.

Using the Table Format Window to Change Column Width


1 2 3

Select the table. Choose Table > Table Properties. Click the Columns tab.

4 5

Specify the column widths. Click OK.

Resizing Columns Using the Optimization Icons


Use these tools to automatically make all columns equal in width, or make them all the right width for their content (optimal width).

Adding and Managing Rows and Columns

191

Select the table.

Be sure you can see the table toolbar; if you cant, choose View > Toolbars > Table. Youll be using the Optimize icon in this procedure, and the options available when you long-click on it. You can distribute the columns evenly, or simply optimally for the content. To make columns equal, click and hold down on the Optimize icon and select the Distribute Columns Evenly icon. The columns will be resized equally.

In the table toolbar, click and hold down on the Optimize icon and select the Optimize Width icon. The column widths adjust to the minimum width the need to display all text on one line.

192

Chapter 11 Creating and Formatting Tables

Splitting and Merging Cells


1

Select the cells you want to merge.

Click the Merge Cells icon on the table toolbar.

The results will look like this.

To split cells, click in a row where youve already merged cells.

Click the Split Cells icon in the table formatting toolbar.

Creating and Applying AutoFormats: The Table Formatting Timesaver

193

In the resulting window, select the correct number of cells and specify vertical split. Dont just accept the default; its usually incorrect

Click OK.

Creating and Applying AutoFormats: The Table Formatting Timesaver


Once youve formatted a few complex tables, you realize that it is a huge time sink. Just applying the formatting once can take a long time; how long would it take you to apply all the formatting at right, to twenty tables? Longer than you want to spend. Luckily, you can save time with AutoFormats. AutoFormats are like styles for tables: you freeze the formatting settings for a table the way you want it, and then just apply it quickly to any other table. AutoFormats dont just retain table formatting; they retain things like font and font size, as well. AutoFormats come with you from one document to another. They also work the same way in Calc spreadsheets.
StandardTable Formatting Borders on horizontal lines only Borders are 2 pts wide and light gray Dark gray-shaded top line Black Arial 12 point text in heading Black Times New Roman 10 point text in body Numbers have $ and two decimal places

Creating an AutoFormat
1

Format a table the way you want it to appear.

2 3

Select the entire table. (In Calc, select at least three cells across and two down.) Choose Table > AutoFormat. (In Calc, choose Format > Autoformat.)

194

Chapter 11 Creating and Formatting Tables

The AutoFormat window will appear. In that window, click Add.

In the Add AutoFormat window, type a name for the format. Click OK.

Click More. Specify any additional options like number formatting.

Youll see a preview of the autoformat in the AutoFormat window.

Click OK.

Applying an AutoFormat to a Table


Once youve created your AutoFormat, youre ready to apply it to other tables you want to format. (You can also, of course, apply any of the existing AutoFormats.) You can also apply an AutoFormat when you create a table in the first place; see Creating a Table Using the Table Menu on page 179.
1

Open a document and select a table that you want to format.

Converting Between Text and Tables

195

2 3 4 5

Choose Tables > Autoformat. The AutoFormat window will appear. In the Format list, scroll down and select the AutoFormat you want. Click the More button at the right side. Unmark or mark any options you want to change.

6 7

Click OK. The table will reflect the AutoFormat.

Converting Between Text and Tables


You can do more than create a table; you can convert it from text, or from a spreadsheet.

Converting Text to a Table


The approach weve shown so far is to create the table structure, then put in the text. Thats fine but what if youve already got some text, and you just want it in table format? Luckily, theres the text-to-table conversion feature.

196

Chapter 11 Creating and Formatting Tables

Select the text. The text needs to be separated with tabs or another separator so that Writer can tell where the columns will go.

2 3

Choose Table > Convert > Text to Table. The conversion window will appear.

4 5 6

Select the item that separates the columns, such as a tab, and set other options such as whether you want a heading row. Click OK. The text will be converted to a table.

Converting Between Text and Tables

197

Converting a Table to Text


This is just the opposite of the previous procedure. Lets say youve got a table full of data and you just want it in paragraphs instead.
1 2 3

Select the entire table. Choose Format > Convert > Table to Text. The conversion window will appear. Leave the values as is, or change the separator item.

Click OK.

Converting a Table to a Spreadsheet


Copy the table, switch to a spreadsheet, click in one cell of the spreadsheet, and paste.

Converting a Spreadsheet to a Table


This is simple, in a way. You need to paste the spreadsheet into a Writer document as formatted text, then just convert that text to a table.
1 2 3

Copy the portion of the spreadsheet that you want to turn into a table. Move to a Writer document. Choose Edit > Paste Special and select Formatted Text. Click OK.

You can also click and hold down on the Paste icon and paste as Formatted Text.
4

The text will appear as a table, but without borders. Select all the text and the table toolbar will appear. Apply a border if you want one on the table. See Adding or Removing Table Borders on page 183.

198

Chapter 11 Creating and Formatting Tables

Automatic Number Formatting


When youve got a big table full of sales figures or prices, its a pain to type all those currency symbols in by hand. Fortunately, OpenOffice.org will do it for you.
1 2 3

Open the document with the table containing numbers. Select the numbers (not the heading) in the numbers column and right-click on that column. Choose Number Format. In the Number Format window, in the Category list, select the number format you want such as Currency. Then in the Format list, select the variant that you want.

In the Options area, specify the number of decimal places, if you want to change the default settings, and how negatives are displayed.

5 6

Click OK. The table will reflect the changes.

Sorting Data in a Table

199

Sorting Data in a Table


This process works with plain text lists, as well; however you can only sort by the first word in the list.
1

Open the document and select the table, without the headings.

Choose Tables > Sort. The Sort window will appear.

Be sure that in the Direction area, Rows is selected. You typically want to sort the rows of data, so that the rows are re-ordered, so this is correct.

200

Chapter 11 Creating and Formatting Tables

Be sure the Key 1 item is selected. Key 1 just means the first thing to sort by. Then in the Column list, type the number of the column you want to sort by. In the example shown earlier, if you wanted to sort by price, you would select Column 3.

Then choose whether to sort by Alphanumeric or Numeric, and Ascending or Descending. You must choose Numeric to sort numbers.

6 7

If you want to sort by another column now, select Key 2, and select the column and options for that sort. Click OK. The data will be sorted.

Doing Calculations in Tables

201

If you have problems sorting numbers, select all the number cells, right-click, choose Number Format, and be sure that theyre a number or currency format rather than Text. If your numbers are left-aligned in the table, theyre not the right format. See Automatic Number Formatting on page 198 for more information

Doing Calculations in Tables


In general, I recommend doing calculations in spreadsheets, then pasting them into your Writer document. However, you can also do some calculations in tables.
1 2

If you want to apply number formatting, see Automatic Number Formatting on page 198. Click in the table, where you want the calculation result to appear.

Choose Table > Formula. The formula toolbar will appear.

Type the calculation. Use <> around the cell references. The first cell in the first row and column is A1, and so on.

5 6

Click the check mark icon. The calculation result will appear in the table cell.

You might also like