# Pin Unpin

## Content

You can pin rows and columns in a tablesheet to display them at the top or the left of the current view when you scroll.

This operation can be performed by right-clicking the specific row or column header and selecting the “Pin/Unpin” option. A separate line is displayed after the pinned rows and columns as displayed in the image below.

![](https://gcdocumentsitekrblob.blob.core.windows.net/document-site-files/images/8d606653-16a0-474d-b9dc-e2b4d01c2446/images/ts-pinned.png)

Similarly, you can unpin a row or column by selecting the “Pin/Unpin” option. At most, only 10 rows or columns can be pinned in a tablesheet view.

> **Note:** The filter and sort features do not affect pinned rows and columns.
> Undo and redo operations are not supported.

You can toggle the pin status of a row or column by using the [TableSheet.togglePinnedRows](/spreadjs/api/v16/classes/GC.Spread.Sheets.TableSheet.TableSheet#togglePinnedRows) or [TableSheet.togglePinnedColumns](/spreadjs/api/v16/classes/GC.Spread.Sheets.TableSheet.TableSheet#togglePinnedColumns) methods as shown in the following code sample.

```javascript
// Bind view to tablesheet
myView.fetch().then(function () {
    sheet.setDataView(myView);
    sheet.togglePinnedRows([4,5]);  // Pin rows
    sheet.togglePinnedColumns([1,3]); // Pin columns
});
```