Formatting Data

From Apache OpenOffice Wiki
Jump to: navigation, search



Formatting Data

The data in Calc can be formatted in several ways. It can either be edited as part of a cell style so that it is automatically applied, or it can be applied manually to the cell. Some manual formatting can be applied using toolbar icons. The Properties tab of the Sidebar also contains panels for Text properties, Alignment, Cell Appearance, and Number Format. For more control and extra options, click the More Options icon at the right edge of the Sidebar panel titles or select the appropriate cell or cells, right-click on it, and select Format Cells. All the format options are discussed below.

Documentation note.png All the settings discussed in this section can also be set as a part of the cell style. If several cells will be formatted identically, defining a cell style makes it easy to keep the format consistent. See Chapter 4 (Using Styles and Templates in Calc) in the Calc Guide for more information.

Formatting Multiple Lines of Text

Multiple lines of text can be entered into a single cell using automatic wrapping or manual line breaks. Each method is useful for different situations.

Using Automatic Wrapping

To set text to wrap at the end of the cell, right-click on the cell and select Format Cells (or choose Format → Cells from the menu bar, or press  Ctrl  +  1 ). On the Alignment tab (Figure 91), under Properties, select Wrap text automatically and click  OK . This setting is also available on the Alignment panel of the Properties deck of the Sidebar. The results are shown in Figure 92 alongside examples of text that overflows into neighboring empty cells or whose display is truncated because the cell does not have text wrapping turned on.

AOO41GS05 038.png
Figure 91: Format Cells → Alignment dialog
AOO41GS05 039.png
Figure 92: Automatic text wrap

Using Manual Line Breaks

To insert a manual line break while typing in a cell, press  Ctrl  +  ↵ Enter . This method does not work with the cursor in the input line. When editing text, first double-click the cell, then single-click at the position where you want the line break or move to the location using the arrow keys.

When a manual line break is entered, the cell width does not change. Figure 93 shows the results of using two manual line breaks after the first line of text.

AOO41GS05 040.png
Figure 93: Cell with manual line breaks

Shrinking Text to Fit the Cell

The font size of the data in a cell can automatically adjust to fit in a cell. To do this, select the Shrink to fit cell size option in the Format Cells dialog (Figure 91). Figure 94 shows the results in the top left cell along with other cells in the default font size demonstrating text overflow or truncation.

AOO41GS05 041.png
Figure 94: Shrinking font size to fit cells

Formatting Numbers

Several number formats can be applied to cells by using icons on the Formatting toolbar. Select the cell, then click the relevant icon. Not all the icons in Figure 95 are visible by default. Icons can be added or removed from the toolbar as explained in the Customizing toolbars section of Chapter 1 (Introducing Apache OpenOffice).

AOO41GS05 042.png
Figure 95: Number format icons. Left to right: currency, percentage, date, exponential, standard, add decimal place, delete decimal place.

For more control or to select other number formats, use the Numbers tab (Figure 96) of the Format Cells dialog:

  • Apply any of the data types in the Category list to the data.
  • Control the number of decimal places and leading zeros.
  • Enter a custom format code.

The Language setting controls the local settings for the different formats such as the date order and the currency marker.

Documentation note.png Changing the format of a cell never changes its value. This can cause confusion when a value that is intended to be a number, such as a date, is interpreted by Calc as text. This may happen, for example, when data is read in from a CSV file. Text has a value of zero and changing the format after Calc has set the value will not change that value. The cell format must be changed and then the data reentered.
AOO41GS05 043.png
Figure 96: Format Cells → Numbers

Formatting the Cell Borders

To add a border to a cell (or group of selected cells) click on the Borders icon on the formatting toolbar, and select one of the border options displayed in the palette.

To quickly choose a line style and color for the borders of a cell, click the small arrows next to the Line Style and Line Color icons on the Formatting toolbar. In each case, a palette of choices is displayed.

Icons for the border pattern options, line style and color are also available on the Cell Appearance panel of the Properties deck of the Sidebar.

For more controls, including the spacing between the cell borders and the text, use the Borders tab of the Format Cells dialog. The same dialog can be reached through the  More Options  button in the line style list in the Sidebar. There, you can also define a shadow. See Chapter 4 (Using Styles and Templates in Calc) of the Calc Guide for details.

Documentation note.png The cell border properties apply to a cell, and can only be changed if you are editing that cell. For example, if cell C3 has a top border (which would be equivalent visually to a bottom border on C2), that border can only be removed by selecting C3. It cannot be removed in C2.

Formatting the Cell Background

To quickly choose a background color for a cell, click the small arrow next to the Background Color icon on the Formatting toolbar or on the Cell Appearance panel of the Properties deck of the Sidebar. A palette of color choices, similar to the Font Color palette, is displayed.

(To define custom colors, use Tools → Options → OpenOffice → Colors. See Chapter 11 for more information.)

You can also use the Background tab of the Format Cells dialog. See Chapter 4 (Using Styles and Templates in Calc) of the Calc Guide for details.

Formatting the Font

To quickly choose the font used in a cell, select the cell, then click the arrow next to the Font Name box on the Sidebar or on the Formatting toolbar and choose a font from the list.

Tip.png To choose whether to show the font names in their font or in plain text, go to Tools → Options → OpenOffice → View and select or deselect the Show preview of fonts option in the Font Lists section. For more information, see Chapter 11 (Setting Up and Customizing Apache OpenOffice).


To choose the size of the font, click the arrow next to the Font Size box on the Formatting toolbar. For other formatting, you can use the Bold, Italic, or Underline icons.

AOO41GS05 044 FontColor.png

To choose a font color, click the arrow next to the Font Color icon to display a color palette. Click on the required color.

(To define custom colors, use Tools → Options → OpenOffice → Colors. See Chapter 11.)

All the formatting options just discussed are also available in the Text panel of the Properties deck of the Sidebar.

To specify the language of the cell (useful because it allows different languages to exist in the same document and be spell-checked correctly), use the Font tab of the Format Cells dialog. Use the Font Effects tab to set other font characteristics. See Chapter 4 (Using Styles and Templates in Calc) of the Calc Guide for more information.

Formatting the Cell Borders

To add a border to a cell (or group of selected cells) click on the Borders icon on the formatting toolbar, and select one of the border options displayed in the palette.

To quickly choose a line style and color for the borders of a cell, click the small arrows next to the Line Style and Line Color icons on the Formatting toolbar. In each case, a palette of choices is displayed.

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