# Spreadsheet Formatting

## Cell Format

To change the format and appearance of selected cell(s), row(s) or column(s) use the Cell Format... option from the Format menu or from the right mouse button pop up menu.

Right mouse button context menu.

This will bring up the Cell Format dialog box which has several tabbed pages:

### Data Formats and Representation

Data Format page.

The Data Format page of the Cell Format dialog box lets you control how the values of cells are displayed.

The top part of this page lets you select the format to be used when displaying numeric values, dates or times.

The lower part of the Data Format page lets you add a Prefix such as a $ symbol at the start of each item or a Postfix such as $HK to the end. You can also control how many digits are displayed after the decimal point for numeric values, whether positive values are displayed with a leading + sign and whether negative values are shown in red.

### Fonts and Text Settings

Text page.

The Text page lets you select the font style, size and color, including some additional options like underlined or striked out text. The lower part of the page gives a preview of the selected text format.

### Text Position and Rotation

Position page.

From the Position page you can control the position of text within a cell by making suitable selections in the Horizontal and Vertical areas or by setting the Indent value. You can also choose to have the text appear vertically rather than horizontally, or even at an angle.

### Cell Border

Border page.

The Border page lets you set the appearance of the cell borders. If you have selected more than one cell you can apply different styles to the borders between the cells and that surrounding the selected area.

First select the pattern and color from the Pattern section of the Border page then apply that to different parts of the border by clicking on the appropriate button in the Border section, or on one of the Preselect buttons. The left hand button in the Preselect section will clear any previously applied border(s). Note that you can also add a diagonal strike-through line to the cell(s).

### Cell Background

Background page.

The cell background pattern and color can be selected from the Background page.

Simply choose a desired pattern, then select the pattern color and the background color.

At the bottom of this page you can see a preview of the configured cell background.

## Conditional Cell Attributes

You can make the appearance of a cell change according to the value it contains, useful perhaps if you are using &kspread; to keep track of your household expenses and want to highlight any item greater than, say, one thousand dollars.

To do this select the cell(s) then choose Conditional Cell Attributes... from the Edit menu. This will bring up the Conditional Cell Attributes dialog box where you can make the font type and color of a cell change when the value meets one or more conditions. Note that the second and third conditions only apply if the previous condition(s) are not met.

Use Clear Conditional Cell Attributes from the Edit menu to clear any conditional attributes from selected cells.

## Changing Cell Sizes

The Position page in the Cell Format... dialog lets you alter the size of the selected cell(s). Note that changing the height of a single cell will change the height for all cells in that row, similarly changing the width will affect the entire column.

You can also select the row(s) or column(s) to be changed then select Resize Row... or Resize Column... from the right mouse button pop up menu or from the Format Row or Format Column menu.

If you move the mouse cursor so that its tip is over the line between two of the row numbers at the left of &kspread;'s window the cursor will change to show two parallel lines each with a short arrow headed line coming from it. When the cursor is in this state you can hold the left mouse button down and drag the border between the two rows, changing the height of the upper row. A similar technique can be used to change the width of a column.

To set the row height or column width to the minimum needed to display the contents, select the whole row or column, and right-click on the row or column label. In the menu which appears, select Adjust Row or Adjust Column. The row or column will resize to the minimum necessary. You can also select a single cell or range of cells, and click Adjust Row & Column from either the right-click menu or the Format menu.

You can make a number of adjacent rows or columns the same size by selecting them then choosing Format Row Equalize Row or Format Column Equalize Column.

## Merging Cells

It is often convenient to have one cell that spreads across two or more columns or down more than one row. This can be done by merging two or more cells into one. Select the cells to be merged than choose Data Merge Cells.

To reverse this process, select the merged cell then choose Dissociate Cells from the Data menu.

## Hiding Rows and Columns

A finished spreadsheet can often be made to look more attractive by hiding the cells containing intermediate calculations so that only the important data input and result areas are shown.

In &kspread; you can hide selected rows or columns by using the Hide Rows and Hide Columns options from the Format Row, Format Column or right mouse button menus. Hidden rows and columns are not displayed on the screen or included in a print out.

Hiding cells in this way also makes them slightly less prone to accidental change.

To un-hide a row or column select Row Show Rows... or Column Show Columns... from the Format menu. In the dialog box which appears, you can select any number of rows to show (use &Ctrl;+click to select multiple rows or columns).