# Formatting Tables

Source: https://docs.astalty.com.au/guide/templates/formatting-tables

> Add a table in Astalty's text editor, then shade its cells, align the text inside them, merge and split cells, and turn header rows and columns on and off.

Use a table when a template or note needs information arranged in rows and columns. Astalty's text editor lets you add rows and columns, shade cells, align text, merge or split cells, and mark header rows and columns.

## Overview

Table controls are available in Astalty's full text editor. You will see this editor when you write the content of a [Document Template](https://docs.astalty.com.au/guide/settings/template-settings), edit a generated document before finalising it, write a note, or write a [Resource](https://docs.astalty.com.au/guide/resources/creating-and-updating-resources). Two toolbar buttons control tables:

- **Insert table** adds a table while your cursor is outside one. It changes to **Table options** while your cursor is inside a table.
- **Cell formatting**, shown with a paint bucket icon, controls text alignment and cell fill. It appears only while your cursor is inside a table.

Shorter fields, including comments, email messages, and alerts, use a smaller editor without table controls.

## Adding a Table

1. Put your cursor where the table should sit.
2. Select **Insert table** in the toolbar.
3. Move across the grid to size the table, then select to insert it.

You can insert up to five rows and five columns. Astalty creates the first row as a header row. Use **Table options** to add more rows or columns, and drag a cell border sideways to change a column's width.

## Table Options

With your cursor inside a table, the table icon opens the structural options.

![The table options menu open from the text editor toolbar over a Schedule of Supports table with two cells selected, listing Insert Above, Insert Below and Delete Row under Rows, Insert Left, Insert Right and Delete Column under Columns, Merge Cells, Split Cell, Header Row and Header Column under Cells, and Delete Table](https://docs.astalty.com.au/assets/template-editor-table-options-menu.png)

| Option            | What it does                                                                              |
| ----------------- | ----------------------------------------------------------------------------------------- |
| **Insert Above**  | Adds a row above the row your cursor is in                                                |
| **Insert Below**  | Adds a row below the row your cursor is in                                                |
| **Delete Row**    | Removes the row your cursor is in                                                         |
| **Insert Left**   | Adds a column to the left of the column your cursor is in                                 |
| **Insert Right**  | Adds a column to the right of the column your cursor is in                                |
| **Delete Column** | Removes the column your cursor is in                                                      |
| **Merge Cells**   | Combines the cells you have selected into one                                             |
| **Split Cell**    | Breaks a merged cell back into separate cells                                             |
| **Header Row**    | Turns the first row of the table into a header row, or back into an ordinary row          |
| **Header Column** | Turns the first column of the table into a header column, or back into an ordinary column |
| **Delete Table**  | Removes the whole table                                                                   |

Astalty disables an option when it cannot be used for the current selection. **Merge Cells** needs more than one selected cell. **Split Cell** works only on a cell that was merged earlier.

To work with more than one cell at a time, select inside the first cell and drag across the rest.

## Shading Cells and Aligning Text

The paint bucket icon opens **Text alignment** and **Cell fill** for the cells you have selected.

1. Select the cell you want to change, or drag across several cells.
2. Select the paint bucket icon in the toolbar.
3. Under **Text alignment**, choose left, centre or right.
4. Under **Cell fill**, choose one of the colours.

![The cell formatting panel open from the paint bucket icon with the header row selected, showing three Text alignment buttons above a Cell fill palette of seven colours with blue ticked, a custom colour button, and a No fill option](https://docs.astalty.com.au/assets/template-editor-table-cell-formatting.png)

**Cell fill** offers grey, yellow, orange, red, green, blue, and purple. Select the **+** swatch to choose a custom colour, or select **No fill** to remove the shading.

Both settings apply to every cell in your selection, so a whole header row can be shaded in one go.

> **Shade a header row to make a table easier to read**
>
> For a Service Agreement, shade the header row and right-align dollar amounts. This makes the headings and totals easier to scan.

![A Schedule of Supports table in the template editor with a blue shaded header row and the Weekly Amount column right aligned](https://docs.astalty.com.au/assets/template-editor-table-shaded-header-row-guide.png)

## Things to Keep in Mind

- Shading and alignment save with the content, so they carry through to the PDF generated from a Document Template as well as to the note or Resource on screen.
- Tables pasted from Excel or Word keep their cell shading. Review older templates that contain pasted tables before using them, because shading that an older editor discarded may appear when you reopen the template.
- **Merge Cells** keeps the fill from the top-left cell of your selection and discards the others.
- **Split Cell** copies the merged cell's fill to every cell it produces, so clear any fill you do not want afterwards.
