# Automatic Outline

A tutorial showing how to automatically outline cell ranges containing formulas in the SpreadJS Designer Component with UI

## Content

SpreadJS provides the option to automatically add the row and column outlines to cell ranges containing formulas. You can access the "Auto Outline" option in Data > Group ribbon button.

![1](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/1.402194.gif?width=800)

If outlines already exist in a worksheet, then a confirmation dialog pops up.

![2](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/2.0b013f.png?width=350)

If selected "OK", all the existing outlines are removed and new outlines are created according to the current formulas.

## Behavior of Automatic Outlines

You can observe the following behavior while applying automatic outlines.

| Behavior | Example |
| -------- | ------- |
| The outline direction follows the formula cell position. | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.32bd11.png) |
| If a row or column range has a different outline direction than the other, the latter will be missed. | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.5434b5.png) |
| If the row or column ranges intersect, only the first outline is grouped. | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.0c31f6.png) |
| If a formula cell's range also contains a formula. all the legal cells are merged. | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.ca5c5d.png) |
| If multiple cells are combined into a legal cell range, an outline is added. | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.8400cb.png) |

## Illegal Cell Ranges

The following cell ranges are illegal in terms of adding an outline.

| Cell Range | Example |
| ---------- | ------- |
| Single cell | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.017fd0.png) |
| Multiple rows and multiple columns | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.f45fa8.png) |
| A misplaced row or column | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.88edcf.png) |
| Cross sheet range | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.6dcb4b.png) |
| Circular reference | ![image.png](https://cdn.mescius.io/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/image.8b7baf.png) |

## Clear Outlines

You can clear all outlines in the active sheet by using "Clear Outline" in the Data > Ungroup ribbon button.

![3](https://cdn.mescius.io/document-site-files/images/7719ad0a-f083-46d7-aff6-f63e2e187c15/3.e47d3a.gif?width=800)

> **Note:** Auto Outlines and Clear Outline options do not support undo operation.