---
title: "WebWorksheet.AutoFitColumn"
url: "https://reference.aspose.com/cells/net/aspose.cells.gridweb.data/webworksheet/autofitcolumn/"
product: "Aspose.Cells for .NET API Reference"
description: "WebWorksheet method. Autofits the column width. This method autofits a column based on content in a range of cells within the column from startRow to endRow. AutoFitColumn is an imprecise function"
---

## AutoFitColumn(int, int, int) {#autofitcolumn_1}

Autofits the column width. This method autofits a column based on content in a range of cells within the column from startRow to endRow. AutoFitColumn is an imprecise function.

```csharp
public void AutoFitColumn(int columnIndex, int startRow, int endRow)
```

| Parameter | Type | Description |
| --- | --- | --- |
| columnIndex | Int32 | column index, zero based |
| startRow | Int32 | start row index, zero based |
| endRow | Int32 | end row index, zero based |

### See Also

* class [WebWorksheet](../)
* namespace [Aspose.Cells.GridWeb.Data](../../../aspose.cells.gridweb.data/)
* assembly [Aspose.Cells.GridWeb](../../../)

---

## AutoFitColumn(int) {#autofitcolumn}

Autofits the column width.

```csharp
public void AutoFitColumn(int columnIndex)
```

| Parameter | Type | Description |
| --- | --- | --- |
| columnIndex | Int32 | Column index. |

### Remarks

AutoFitColumn is an imprecise function.

### See Also

* class [WebWorksheet](../)
* namespace [Aspose.Cells.GridWeb.Data](../../../aspose.cells.gridweb.data/)
* assembly [Aspose.Cells.GridWeb](../../../)


