March 27, 2008

Four Table Tips for OpenOffice Writer: Blank line above a table, splitting tables, automatic optimal column width, and joining tables

Tables generally behave as you might expect. They're fairly straightforward and not too troublesome.

But sometimes the features aren't that obvious. So here's a blog on useful stuff you can't easily see, as well as one feature Word users might expect that isn't there, but for which there is a decent alternate route.

Getting a blank line / carriage return at the top of a document when the table is at the top already
Here's your table. Let's say it's, oh, top performers for Amway from each state, or the exciting new political movers and shakers from each state. And it's right at the top of the page, but you want to write an intro paragraph like "Let's welcome the new political movers and shakers from the Midwest!"

Table

Just click in the top left cell
Pressreturn1

and press Return.

Pressreturn2_2

Splitting a Table
This is relatively straightforward, but there are four ways to split it. Here's your table. Note that the first line is bold and centered. The Table Heading paragraph style is applied to that row in the table.

Split1

First, click at the left of the column that you want to have as the first line of the new table.

Choose Table > Split Table.

Split2

Now you have options.

Split3_3

Copy Heading is just what you would expect. The results look like this.

Copyheading_2

Custom Heading Apply Style is useful only if the line you're splitting on is going to be used as a heading. Here, it's pretty silly. It applies the paragraph style from the heading of the table to the top row of the new table. Also the first row is a heading, i.e. it will repeat at the top of the next page if the table goes far enough to continue to the next page.

Customheadingapplystyel

Custom Heading is the same except that it doesn't apply any paragraph style. But the first row of the new table will still repeat on the next page if the table goes long enough, since it's a heading.

No Heading is the simplest approach -- it splits the table and does absolutely nothing else to it.

Automatically adjusting spacing to fit the text

Let's say you've got this table. You probably want to give the far right column a little more width, definitely, and maybe adjust some of the other columns to suit how much content they have.

Even1_2

Select the entire table. The Table toolbar will appear. The icon you want is the Optimize icon. (The icons shown here are for Ubuntu, use your tooltips if necessary on your version of OpenOffice.org.)

Even2

Click and hold down the arrow for the Optimize icon. All of these are useful but you want the far right icon, Optimal Column Width.

Even3

And here's the result.

Even4

Joining Two Tables

Sorry, there's no quick way to do this. Tables are just normal tables in Writer, and so part of the normal text flow. You can't just join text chunks. However, it's not too much work to copy and paste.

You have a table. You then have a blank line or three, then another table. You want them to be one table.

- Copy the second table (leave out the heading rows).
- Create a blank row at the end of the first table.
- Click in the first cell of that blank row.
- Paste
- Delete the second table now that you've pasted it into the end of the first table


Traininglogo




January 19, 2007

Weird Calculation and Sorting Problems in OpenOffice Calc Spreadsheets and Writer Tables

This is a followup of my post yesterday about correct cell format.

Sometimes weird stuff happens in cells.

  • Calculations don't work. They just sit there displaying the formula instead of running and displaying the results.

Sitsthereanddoesntcalculate

  • Date formats don't work. You type in a perfectly good date and some bizarre number appears instead.
  • Sorting doesn't work. Sorting numbers might change the order, but to an order you don't expect.

Why? Because the cells think that they are text. So it doesn't make sense to do calculations. You can't multiple bread * milk, so  you can't multiply two other things that Openoffice thinks are text.

This happens in Calc spreadsheets and Writer tables. To find out if the contents of your cells are deluded about their identity, select them, right-click, and choose Number Format.

If you see this, then the cells have the wrong format.
Textformat

To correct this in Writer, just select the correct format and click OK.

To correct this in Calc:

  • Close the number formatting window
  • Select the problem cell
  • Cut out the contents -- be sure to select and cut the series of characters in the cell, not the cell itself
  • Reselect the entire cell, then press Delete
  • In the window that appears, be sure that Format is selected. Click OK.

Deletewindow_1

  • With the cell still selected, right-click again and choose Format Cells. Select the correct format and click OK.

Currencyformat

  • Choose Edit > Paste Special
  • Choose Unformatted Text and click OK

Pasteunfromattedtext

  • Now the calculation should work correctly. And if it wasn't a calculation but a number, now rerun the sort and it should work correctly.

Resultreformatted

See yesterday's post about number recognition, toward the end, for how to recognize a badly formatted cell that thinks it's text, even though it might have a $ and decimal places.




January 18, 2007

A Little Thing About OpenOffice Number Formats in Writer Tables and Calc Spreadsheets

I was just putting together a proposal, putting in the numbers for each category in a Writer table, just like I always do. I was applying automatic number formatting for the currency amounts.

Rightalign_1

The number formatting was being really annoying, though. I set the number format for a bunch of blank cells, then had to set it again when I put in the numbers since it didn't take.

I also had to re-apply currency formatting when I changed a number. It was $800.00, formatted correctly, and when I changed it to 900, it left-aligned itself and changed its number formatting to Text. That was particularly annoying.


Before we continue,  why do you care about number formatting? It's convenient but there's more. Note that the particular issue I encountered exists in Writer, but the problems if you don't have correct number formatting exist in both  Writer and Calc.

  • It's easier to apply formatting that will make decimals and currency symbols appear than to retype it.
  • Sorting won't work correctly if the numbers don't know they're numbers.
  • Calculations won't work correctly if the numbers don't know they're numbers.

Back to the topic at hand -- why was this happening? Why was number formatting misbehaving? It usually doesn't. But it was today. It's because the default setting "Number Recognition" had been removed. Or maybe it's not on by default in 2.1.

Making Sure Your Number Formatting Sticks
Here's what to do to prevent number formatting annoyance.

1. Create your table.

2. Select the cells that you want to have numbers in.

3. Right-click and choose Number Recognition. You want a checkmark to appear next to  This will keep OpenOffice.org aware that the content you enter is, indeed, numbers and that the program should darned well apply number formatting when you tell it to.
Num1_1

4. Now, apply the appropriate number formatting. Right-click again on the selected cells and choose Number Format. Have your way with it, select the options you want, then click OK.

Num2_1

Notes on How to Detect Incorrectly Formatted Cells
A correctly formatted cell is right aligned like these.

Rightalign

You can have the currency symbol and decimals applied correctly, BUT if the numbers are left aligned, then they still don't know that they're numbers. They think they're text. Weird, huh? So keep an eye out for left-aligned correctly formatted numbers.

Leftalign




December 10, 2006

Getting an HTML Table Into a Spreadsheet in OpenOffice Calc

Logo_htmltospreadsheet_1

I blogged here about how to get a spreadsheet into a Writer table.

As for the opposite, getting a Writer table into a spreadsheet, you just copy and paste. Very easy.

How do you get an HTML table into a spreadsheet?

Or, frankly, how do you just suck some HTML content into a spreadsheet?

You should be able to copy and paste--when I paste a table, it comes into the spreadsheet nicely with the rows and columns  retained correctly. However, I understand that doesn't work for everyone. So you can use this approach, instead.

Also, if you are so inclined, how do you get it to update regularly? Maybe you want to display stock quotes from a Web page--you can choose to put those in a spreadsheet and have them update every 30 or 300 seconds.  (This feature works correctly with links to files and it really should work, in theory, to link your spreadsheet to a web page on the net but I can't get it to work with a URL, just with a file. If anyone else can, write and let me know how.)

In this case, you might always want to use this approach.

1. Go to the web page containing the table that you want to use. Save the file to your computerif it's not there already. The window and the online help indicate that you can just link to a URL starting with HTTP but I can't make it work.

Also, take a look at the tables if there are more than one. You're going to need to figure out which table you want by knowing what order the tables appear in.

Link1

2. Go to your spreadsheet. Click in the cell at the upper left range of where you want the table(s) to appear.

3. Choose Insert > Link to External Date.

4. In the window that appears, browse to the file that you saved to your computer. If you want to try making an HTTP URL work, then paste in that URL instead. The online help says to paste it in, then press Enter.
Link2

5. Select the content you want to insert. HTML_All inserts everything in the HTML page. HTML_Tables inserts all the tables. HTML_1 inserts the first table, and so on.

6. Select the Update Every option, if you want to update the content, and specify how often in seconds. This does work, but it has a drawback that we'll see later.

7. Click OK.

8. The HTML content you selected will appear.
Link3

9. To format the content to wrap within the cell, select the cells, choose Format > Cells, and in the Alignment tab select the Wrap option shown. Click OK.

Link4

10. Whenever the HTML file changes, the spreadsheet updates. However, as you will see, all your beautiful wrap formatting goes away.

Link7

If your content in the table is fairly wide, then:
- Resign yourself to it looking like this in the spreadsheet
- Widen the cells in the spreadsheet
- Don't choose to update the content


 


November 15, 2006

UPDATED AND CORRECTED APRIL 6 2007: Getting Data Back Out of OpenOffice Base (not exporting, exactly, but pulling the data kicking and screaming)

Logo_datainandout


THIS IS NOT THE BEST WAY TO DO IT. IN OPENOFFICE.ORG 2.2 THERE IS A BEAUTIFUL AND SIMPLE WAY. Click here.

Note: Having clearly labeled import and export features for Base has been proposed and you can vote for it by clicking one of the following links. Here's how to make things work until the features are implemented and put into the next build.

Vote for adding a wizard to import data into Base
http://qa.openoffice.org/issues/show_bug.cgi?id=51904

Utility to export CSV from Base
http://wiki.services.openoffice.org/wiki/CSV_export


In Base, simple features like, oh, Import and Export, are cleverly hidden. I've written an article on how to get your data in a Base database table, query, or view, out into the cold light of day so you can have it in a table, spreadsheet, or delimited text file.

Here's the article on bringing the data kicking and screaming out of OpenOffice.org Base.
http://searchopensource.techtarget.com/tip/0,289483,sid39_gci1226457,00.html

Here's the related article on the cleverly disguised import function, for getting data from a spreadsheet, Access, or another database into an OpenOffice Base database.
http://searchopensource.techtarget.com/tip/0,289483,sid39_gci1222186,00.html

 


August 21, 2006

Some Very Precise Table Control Settings in OpenOffice Writer

Logo_tablealignment

If you don't have really specific requirements, you can just insert  a table and drag the columns around to make it spaced the way you want it.

Dragaround

You can also do a lot of good work with the automatic spacing options on the Table toolbar. (View > Toolbars > Table.)

Tabletoolbar_1

But for good old-fashioned "I want this column to be 2.53 inches wide and I don't care who think's that's anal and geeky" control, you want the Table and Colums tabs of the Table Properties window. (Table > Table Properties.)

Here we go.

So let's say you're not happy with the table just spreading itself all over the whole width of the page. You can drag the right-hand edge if you want or you can be more precise.

Select your table and choose Table > Table Properties. Click the Table tab.

To align at the left, which is the default, select Left. However, to have an indent from left, select From Left.

Then in the Left field, specify how far in from left you want to indent, such as a half inch.

Tabletab_left

Click OK, and you see the results.

Tablealignfromleft_results

Also in the Table Properties window, if you selected the table and went back in again, you could specify a smaller width for the table in the Width field. The value for how far in from Right the indent is would be recalculated, in the Right field.

Tabletab_left2

Click OK, and you see those results.

Tablealignfromleft_results2

The other interesting option in the Table tab, for alignment, is the Manual tab. Select Manual, and  set your indents from the left and right in the Left and Right fields.

Manual_tabletab

You can use the Manual setting in combination with the column measurements in the Column tab. Click the Column tab.

If you leave both the checkmarks unmarked, here's what happens. Just put the measurements that you want for each column in the appropriate field. If these measurements don't add up to the same amounts you set in the Table tab, then the margins will be adjusted and the column widths will remain the same.

Manual_columnstab

Click OK and you see the results.

Manual_results

Let's say that you want the margins to be the same but the table width to be adjusted, under the same circumstances. Then select the Adapt Table Width checkbox, and the margins from the Table tab will remain the same but the column widths you enter here will be goofed around a bit. I find this setting a bit annoying, but try it if the margins are the most important thing.

Manual_resultswithadapttablewidth_1

If you want to still preserve the margins but adjust the widths of the columns proportionately under the same circumstances, select the Adjust Columns Proportionately checkbox. Warning, however. It's not proportionate adjustment. If you have columns of 3, 2, and 1, and you decrease the first column to 2.5, then both of the other columns are decreased by the same amount. This is weird.

Manual_adjustproportionately

That's about it for today's installment of table measurement control. Generally, if you want absolute control, select the Manual option in the Table tab. Then enter your margin measurements in the Table tab and your column measurements in the Columns tab. And don't select either of the wacky checkboxes in that tab.


July 19, 2006

Doing Calculations in Tables, in OpenOffice Writer (Repost)

(First posted February 2006)

Doing calculations in tables is a nice feature of OpenOffice.org Writer. You can essentially treat a table like a spreadsheet. With this example, for instance, I can just use spreadsheet-like calculations in the table to get the totals and differences.

Tcalc1

The process is a bit different in 2.0 so I'm blogging it here; plus anyone who hasn't used the feature before can see if they like it.

Note: I personally prefer to use spreadsheets, so I would do the calculations in a spreadsheet and then just copy and paste. But for those who like tables, here's how you do it.

This process focuses on summing, with some other options.

First, of course, create the table the way you want it.

Then click in the empty cell where you want a calculation. Choose Table > Formula or press F2 and you'll get the spreadsheet-like toolbar with the formula entry field.

Tcalc2

If you know what you want and just want to go right ahead and do it, just type what you want using <> around each cell reference. <F5>, <A1>, etc.

If you want some help from the system, do it this way. Select the cells you want to calculate; you'll get an addition formula by default. This will sum the contents of the selected cell range.

Tcalc3

If it's what you want, press Enter or click the green arrow by the formula field. The total will appear.

Tcalc4

If it isn't what you want, just retype the formula in the formula field. Be sure to preserve the syntax with the <> around each cell reference. Cell references are the same as Calc, with A1 being the upper left cell of a table and counting across to B and down to 2, and so on. A correct subtraction formula for instance is =<b2>-<c2>

In the following example, I of course want to find the difference, not the sum, of the expenses and income, so I changed the formula.

Tcalc5

If you want something more complicated than addition, subtraction, multiplication, and division, click on the formula dropdown list.

Functiondropdown

To format the cells automatically with dollar signs, etc.. select the cells, right click, and choose Number Format. In the window that appears, select the format you want. Click the following image to see a larger image of the window, if you want.

Numberformat_1 

Overall, the table formulas work but they're just a bit twitchy. If you've got something beyond simple math, I suggest doing it in a spreadsheet, then copying and pasting the spreadsheet into Writer.



July 07, 2006

Breaking Up Is Not Hard to Do (Just Like Getting Back Together) With OpenOffice Writer Tables

Tablesplitlogo_3
   

Splitting Up
If you've tried to insert a page break in a table, you might have gotten a little frustrated.

A normal page break  just jumps the table to the next page.

You can let the table naturally split over pages (Under Table > Table Properties, Text Flow tab, there's a check box for this and it's the default setting.)

If you want more control over where the split is, here's what to do. You actually split the table first, then insert a page break.

1. Click where you want the page break to be.
2. Choose Table > Split Table.
3. You'll see this window.

Splittablewindow_1

4. Select how to split.

  • Select Copy Heading to repeat the heading without changing it.
  • Select Custom Heading (Apply Style)  if you want a heading but a different one. The new blank row that's inserted for your heading has the same paragraph style as the first row in the original table. You usually want this one.
  • Select the other Custom Heading if you want a heading with different content, and a different paragraph style.
  • For no heading, select No Heading.

5. Click OK.
6. Now insert the page break above the second table (Insert > Manual Break, select Page, click OK).

Note: Be careful about splitting tables containing formulas.

Getting Back Together

What if you want to get the tables back together and it's too late to Undo?

1. Select all the rows in the second table and copy them.
2. Go to the bottom of the first table.
3. Make a new blank row. (Click in the bottom row and choose Table > Insert > Rows, or click the Insert Row icon.)
Insertrow

4. Click in the first cell of the new blank row.
5. Just paste.
6. Delete the second row. (Or if you're feeling confident, in step 1 you could have just Cut instead of Copying.)


June 29, 2006

Pasting OpenOffice Calc Spreadsheets Into Writer, as Tables

Logo_pasting

Alexander Kjerulf (http://www.positivesharing.com ) wrote to me with an excellent question.

How do you get a spreadsheet into a Writer document?

The question is interesting, since it's not really that it's hard—there are just so many ways and many possible results. It's kind of like asking “How do you make a really great vinaigrette?” or “What is the best episode of Buffy the Vampire Slayer?” There is no one right answer

Here are some answers, then. My birthday is coming up, so let's say that I'm planning my ideal birthday weekend and I did it in a spreadsheet first.

Ss_1

However, let's say that I've had the brilliant thought that I should leave it lying around where my boyfriend is sure to see it, so that he can help facilitate some of these items. In this case, I would like it to be in a regular document, with a nice heading across the top.

Ideal

In short, I want to take some content from a spreadsheet, and turn it into a table.  I'm going to paste.  But which of the many pasting approaches is best?

Just Pasting the Spreadsheet Normally

Copy the cells from the spreadsheet that you want, switch to a Writer document, and paste.

You get a thingamajig that is kind of a table. Note the table icons in the toolbar. However, you can't really use them except to do things like wrap text around the table or apply other properties to the table object.

Pasting normally gives you kind of a table object with a table look

Pastedwithtoolbar

Double-click in any of the cells so that you can select the text and the cells and basically do normal things to it. But when you do this, iit magiliciously turns into a spreadsheet, with spreadsheet icons. You don't have the table icons anymore.

Double-clicking a pasted spreadsheet gives you spreadsheet tools and a temporary spreadsheet look

Pasted_withcalctoolbar

This could be quite useful if the spreadsheet were chock full of numbers. However, since it's just full of Wonderful Birthday Ideas, I don't really need it to act like a spreadsheet.

The quest for the perfect way to paste this into a Writer document continues.

Exploring the Paste Special Options

When you choose Edit > Paste Special, or click and hold down on the Paste icon in the main toolbar, you get extra pasting options.

Callout_types

You probably won't use the metafile or bitmap that much, since they create graphics. And the calc8 option just does exactly the same thing as normal pasting. However, the rest are quite useful.

Using the HTML (HyperText Markup Language) Paste Special Option

As you might guess, using this option pastes an HTML table version of your spreadsheet. This is pretty slick if you are, for instance, creating a web page. And it's a table, so of course you get the table tools. Not just when you click on the table but when you click in the cells or select the text.

Pastedashtml

Using the DDE Link Paste Special Option

This is a very slick pasting option—it's one of the two I recommend. You get a Writer table version of the spreadsheet content, but it's linked to the original spreadsheet. When the original spreadsheet changes, this copy of it changes, too. Of course, you have full use of the table icons.

Pastedasddelink_best_putinbook

Consider this option even if you don't want the link because you retain any border formatting or background shading.

This is also nice since, as you might have noticed, the alignment was corrected. In the spreadsheet the alignment by default was at the bottom of the cell. Now, it's at the top. If this isn't what you want then it's a disadvantage, but it's what I want in this instance.

Using the Unformatted Text Paste Special Option

When it says unformatted, it means unformatted.
Pastedasunformattedtext

However, what you can do with this, if you want, is to re-convert it to a table using the instructions here.

http://openoffice.blogs.com/openoffice/2006/06/converting_text.html

It's a bit of extra work since you can also use the DDE Link or Formatted Text options to get a regular table.

Using the Formatted Text (RTF) Paste Special Option

This is the other one I recommend. You get a plain old table, in normal Writer format, that's not linked to the original spreadsheet. With the table icons. However, you do lose any formatting associated with the borders or background shading that you might have had in the spreadsheet.

Pastedasformattedtext


June 28, 2006

Sorting Information in OpenOffice Writer Tables

Sort_logo_1_1 

A table of ten or so rows is easy to find information in.

A table of ten pages—that's harder.

To make things easier on yourself, you might want to sort the information. Here's how to do it. (This procedure actually kind of works with regular lists, but not very well. Tables are better.)

Here's the table I'll use as an example. (Imagine it's incredibly long, so that the time we'll save and convenience provided will be immense.)

Sort1

Select the table, including the headings.

Choose Table > Sort. You'll see this window. It looks really techy and complicated, which it is, but I'll point out the really important stuff.

Sort2_1

This part is very important. Be sure that you select Row where indicated. This means that it is the rows of information that will be re-ordered. However, you're sorting by a particular column, like the Name or Postal Code column, and Column will show up elsewhere in the window where you do the actual sorting. It's kinda stupid and complicated, but you'll get used to it.

Now you select the column to sort by. Leave Key1 selected, then specify the column you want to sort by (might be Firstname, but you just select the number). Also select the type of data, Alphanumeric or Numeric. If you're sorting by numbers, you MUST select Numeric. Then select the order: Ascending (A-Z, 1-9) or Descending (Z-A, 9-1).

Click this image to see it a bit bigger.

Sort_callout

If you want to sort by two columns, such as by state and then by last name, for instance, then you'll want to use the Key 2 options. For Key 2, select the column to sort by, the type of data, and the order, Ascending or Descending.

Click OK.

There you are, all sorted.

Sort4_1 


June 22, 2006

Quick and Easy Automatic Numeric Formatting in OpenOffice Writer Tables

Pitchfork_formatting_logo_1

One of the great principles of information production is:

Separation of Content and Presentation

The more separate they are, the more you can change one without affecting the other. And the more you can make changes fast.

You already know how to do this. Styles are one example. Another is the automatic number formatting you can apply in spreadsheets. Typically this is for numbers that express dates, dollars, percentages, etc. Here's the spreadsheet with no formatting, and below with automatic currency formatting.

Num1

You might not know yet, however, that you have the same abilities with numbers in Writer tables. Here's the same information in a table.

Num2

To quickly apply or change the number formatting, select the cell or cells, right-click, and choose Number Format.

Num3

In the window that appears, select the format you want. First select the Category, then the Format. You can fiddle around with the options below the lists, including number of decimal places.

Num4_1

Click OK, and you've got the formatting. If you change your mind later and want different formatting, it's easy to change; just repeat this procedure and pick different options.

Num5


June 20, 2006

Converting Text to Tables in OpenOffice Writer

Convert_logo_2

Tables are a good way to arrange data. Nice, structured, borders between each cell, etc.

The only question is, how do you get the data into a table format?

You can type from scratch, of course. You can painfully copy and paste.

Or if your data is set up right, with a tab or comma or other item separating the data into columns, you can just convert the text to a table.

Let's say you've got this. The arrows are tabs separating the "columns" of data.  (And let's say that it's actually about ten pages long, since this feature is a big timesaver but only if you've got a bunch of data to convert.) The blue is just artistic license.

Text_background

Select it all.

Textselect

Choose Table > Convert > Text to Table.

Convertnavigation

You'll see this window, where you can specify exactly what separates each column of data. It might be a tab, a comma, etc. Also set the options for headings, in the bottom part of the window. The example text here has headings, but yours might not.

Convertwindow_1 

If, through some sort of search-and-replace procedure, or for whatever reason, the % or & character separates each column, then you can specify that. As long as it's a keyboard character, you can specify it.

Couldbeanything_1 

Click OK, and you've got your table.

Tableconverted_1 


June 16, 2006

AutoFormats in OpenOffice Writer (Also Works in OpenOffice Calc Spreadsheets)

Logo_autoformats

It's time for autoformats. Autoformats are going to save you SO much time, if you do tables with even vaguely complex formatting. Autoformats are like styles for tables -- they capture all the complicated border and shade formatting, "freeze" it under a name like Gray and Red Table, and can be applied easily to new tables.

This is part 3 of the Table series ( here's the first post and here's the second post). Last time, we talked about how, while there are many formatting options for tables and a lot of control, it's a lot of work to do that formatting. And in a large document with 20 or even 2000 tables, that turns into a ginormous amount of work.

Let's say you've got this table, and you need it formatted this way. And you need the other 147 tables in the document formatted this way, too.

Table_wantonelikethat

All you have to do is:

1. Get the table formatted how you want—including fonts, number formatting (right-click on a number in a cell and choose Number Format), etc. AutoFormats preserve not just formatting characteristics but also fonts.

2. Turn it into an Autoformat

3. Apply that Autoformat to other tables

I've already done step 1, formatting the table.

Let's do step 2. Here's how to make an Autoformat.

Select the formatted table and choose Table > Autoformat.

In the window that appears, click Add. (You might see more autoformats than this.)

Auto1

In that window, type the name of the autoformat, as descriptively as possible. Click OK.

Auto2

The autoformat appears. Click OK.

Auto3

Now we're on step 3.  You have another table that you need to apply the formatting to.

Autoapply0

Select it and choose Table > Autoformat.

Select the autoformat you want.

Autoapply1

Click More – you can choose whether to include the other formatting shown, when you apply the autoformat.

Autoapply2

Click OK.

You'll see the autoformat applied—I'm showing the original and the newly autoformatted tables together. Click to see the illustration larger.

Autoapply4

Note that the outer border format is applied to the inside of one column here, since this table has one more column than the table the autoformat was based on. It's a good idea to test and tweak a little bit. If you want to do outer and inner borders differently, make your first table with three or more columns, so that the formatting applies correctly to all tables.

See how simple that was, though, overall? Reapplying the formatting is SO much faster with Autoformats. You can spend vast amounts of time applying formatting to tables manually; autoformats get rid of all that work. Also, unlike styles, autoformats aren't just available by default in the document where you created them. They're available in any document you create. 


June 14, 2006

Table Formatting in OpenOffice Writer (Works for Calc Spreadsheet Cells, Too)

Logo_tableformatting 

This is part 2 of the Table series (here's the first post). In this post, I'll show you how to make your tables look exactly the way you want them with border colors, border styles, border placement, and shading. (The first post covered how to control column width; other posts will cover more complex items like vertical spacing, headings, captions, and other advanced table stuff.)

Let's say you've got this fabulous table full of very important information.

Tableexample

It's nice content, but this is, after all, for a glossy brochure on the candidates for mayor, so you want to make it look a little fancier. The candidates, especially that snob Stephanie, would be insulted if you sent this out as is.

So you'll need to make the borders and shading fancier. Bring up the Tables toolbar (View > Toolbars > Table). Dock it and drag it to the top of the work area to dock it.

Tabletoolbar

Click and hold down on the downward-facing black triangle at the far right end of the toolbar and make sure you've got all four of the formatting icons: Line style, line color, borders, and backgrounds. If no check mark appears next to one of them, select it and it'll be added to the toolbar.

Visibilebuttons_1

The first thing you do is to specify where the borders should be. You can put the borders on just horizontal lines, on horizontal and vertical (as is), on just the top and bottom of the table, etc. You do this first because if you do the formatting, then change where the borders go, all your previous formatting might go away. (Later I'll talk about AutoFormats which will solve that problem, but that's a topic for another blog.)

So select the table. Let's say that you want to put the borders only on the horizontal lines, not vertically You'd think that you'd click and hold down on the Borders icon and choose horizontal, as shown.

Borderplacement1

That's logical but that's not quite the way it works. You need to clear the border positions first by saying you don't want any borders anywhere. You can't just switch from one to another directly. So first, click on the No Borders At All icon in the upper right corner, as shown.

Borderplacement2_clear

Now select the horizontal-only borders icon, or whatever icon you like in order to apply the border placement you want. The formatting will be applied.

Borderplacement3

Now, format up a storm. In addition to border placement, you can change:

  • Border style -- Double lines, thin lines ,thick lines, etc.
  • Border color -- And keep in mind that if you reallllly want to go nuts, you can make your own colors.
  • Background shading -- A background color for the heading row is one nice effect. Alternating shading can be very effective for making long tables easier to read. Be sure that you change the font color as necessary to make sure the table is legible.

 

Border Style
Select the table, select the border style icon, and pick something.

Borderstyle

Border Color
Select the table, select the border color icon, and pick something.

Bordercolor

Background Shading
Select the table, select the background shading icon, and pick something.

Shading

Removing a Color
To remove border color or background shading formatting, choose the No Fill option.

Nofill

Here's your table. (It's pretty horrible in color, of course, but it shows some of the effects.)

Formattingresults 

Now, you might also want to just apply formatting to one row. For instance, you can select the heading row, apply a heavier border style and different border color and shading color. Maybe you just have shading on the heading row and nowwhere else. The basic message here is, select the column or row to apply formatting to; you don't have to apply the same formatting to the entire table.

Borderonebyone

Here's the big cahuna, which I'm just going to touch on lightly since it's really just about whatever you want to do with it. Let's say you want some really specific formatting in different parts of the table. Select the table, choose Table > Table Properties, and click the Borders tab.

Tableprops1

As when you used the toolbar icons, you first select WHERE you want the formatting. Use the prefab icons or click on a line in the User-Defined area. To deselect a line, click on it again or click somewhere else.

Tableprops2

Then specify the formatting such as line style, color, etc.

Tableprops3

Set other options such as distance from text, shadow, etc.

Tableprops4

Click OK.

All That Work to Format Just One Table?????

This was a lot of work, wasn't it?

Doing it once is a lot of work. Doing it 40 times is hard labor.

Wouldn't it be nice if there were something like styles, but for tables, that would preserve the formatting for a table and allow you to reapply it to any other table?

Hmmm.... ;>

Tune in next time.


June 12, 2006

OpenOffice Tables in Writer: A Set of Solid Basics

Logo_tables_basic

A reader wrote to me with some questions about moving tables, and I realized I hadn't done much about tables in this blog.  It's high time, of course. Writer tables are a bit different than in MS Word, so it's definitely worth explaining those key differences.

Here's a basic table in Writer. Nothing surprising--you have a header row (optional) with different formatting (by default), and borders on every column and row (by default).

Tabledemo_1 

This is the first post, on creating them, moving them, changing width, etc. All the table blogs will be in the new Tables category.

Creating Tables

Creating tables is pretty simple. Just choose Insert > Table, or Table > Insert > Table. When you get the following window, just mark your choices. Keep in mind that the number of rows includes the heading row (which you usually want, but not always).

Tablecreate1

Another approach is to click and hold down on the Table icon shown, in the toolbar at the top of your work area, and just select the layout you want.

Tablecreate2_1 

Turn On Nonprinting Characters

It's much easier to tell what's going on in text documents, and in tables, if you have nonprinting characters showing. These are mainly the carriage returns, but also spaces (little dots) and tabs (arrows). Choose View > Nonprinting Characters and select it to put a checkmark by it.

Showcharacters_1 

The nonprinting characters will appear.

Showcharactersintable

Make Sure You've Got the Table Toolbar

The Table toolbar has a host of goodies to use. Choose View > Toolbars > Table if you don't see it.

Tabletoolbar1

Drag it up to be with the rest of the toolbars and release, to dock it, so that it will stay around rather than appearing and disappearing as you click in and out of the table.

Tabletoolbar2

What If You Want a Space Above Your Table?

Here's something that happens a lot. You've inserted a table at the top of the document, but now you need text above the table.

Tablespace1

All you have to do is click in the upper left corner and press Return.

Tablespace2

Deleting Tables

If you just select a table and its content and press Delete, only the content is deleted. Now, if you just want to delete the content, that's great. But to delete the table, you need to do one of the following:

Select the blank line above the table, as well as the table, and press Delete.

Deletetable1

Or select the table, right-click, choose Row > Delete or Column > Delete.

Tabledelete2 

Or select  the table, and click the Delete Row or Delete Column icon on the Table toolbar.

Deletetable3

Adding Rows or Columns

You can add rows or columns with the icons on the toolbar. Click in the row or column next to where you want to add the row or column, and click the appropriate green icon.

Addrows1

You can also click in the lower right cell of a table and press Tab. You'll get a new row.

Moving Tables

If you want to move a table, just cut and paste. Select the whole table, plus the blank line above it. Cut (Ctrl X), then go to where you want the table and paste (Ctrl V).

Deletetable1_1

Changing Column Width Manually

You can drag the column widths to change them, or use the big properties window.

Here's how to drag:

Click in the column that you want to change. You'll see markers on the ruler for the columns.

Width1

Move your mouse over the column marker. You'll see the mouse pointer change as shown.

Width2

Click and hold down on the column marker and drag it right or left to change width.

Width3

Release and the column will have a new width.

To change the right and left margins of the tables, move your mouse over the part of the ruler where it changes from white to gray, and drag as you did to change the column width.

Width4

To do this in a window instead, select the table and choose Table > Table Properties. Click the Column tab and type the width values for each column. Click OK.

Width5

When this blog continues....more on things like borders and shading, autoformats, automatic column width adjustments, and much more!


February 08, 2006

Doing Calculations in Tables, in OpenOffice Writer

Doing calculations in tables is a nice feature of OpenOffice.org Writer. You can essentially treat a table like a spreadsheet. With this example, for instance, I can just use spreadsheet-like calculations in the table to get the totals and differences.

Tcalc1

The process is a bit different in 2.0 so I'm blogging it here; plus anyone who hasn't used the feature before can see if they like it.

Note: I personally prefer to use spreadsheets, so I would do the calculations in a spreadsheet and then just copy and paste. But for those who like tables, here's how you do it.

This process focuses on summing, with some other options.

First, of course, create the table the way you want it.

Then click in the empty cell where you want a calculation. Choose Table > Formula or press F2 and you'll get the spreadsheet-like toolbar with the formula entry field.

Tcalc2

If you know what you want and just want to go right ahead and do it, just type what you want using <> around each cell reference. <F5>, <A1>, etc.

If you want some help from the system, do it this way. Select the cells you want to calculate; you'll get an addition formula by default. This will sum the contents of the selected cell range.

Tcalc3

If it's what you want, press Enter or click the green arrow by the formula field. The total will appear.

Tcalc4

If it isn't what you want, just retype the formula in the formula field. Be sure to preserve the syntax with the <> around each cell reference. Cell references are the same as Calc, with A1 being the upper left cell of a table and counting across to B and down to 2, and so on. A correct subtraction formula for instance is =<b2>-<c2>

In the following example, I of course want to find the difference, not the sum, of the expenses and income, so I changed the formula.

Tcalc5

If you want something more complicated than addition, subtraction, multiplication, and division, click on the formula dropdown list.

Functiondropdown

To format the cells automatically with dollar signs, etc.. select the cells, right click, and choose Number Format. In the window that appears, select the format you want. Click the following image to see a larger image of the window, if you want.

Numberformat_1 

Overall, the table formulas work but they're just a bit twitchy. If you've got something beyond simple math, I suggest doing it in a spreadsheet, then copying and pasting the spreadsheet into Writer.