# Setting the Row Height or Column Width

Spread for ASP.NET allows you to set the row height or column width as a specified number of pixels. Learn more in documentation.

## Content

You can set the row height or column width as a specified number of pixels. Each sheet uses and lets you set a default size, making all rows or columns in the sheet the same size. You can override that setting by setting the value for individual rows or columns.
You can set the column width with the [Width](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Column.Width.html) property of the [FpSpread](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.html) component [Columns](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.Columns.html) object. You can set the row height with the [Height](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Row.Height.html) property of the [FpSpread](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.html) component [Rows](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.FpSpread.Rows.html) object.
You can also use the [DefaultColumnWidth](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.DefaultColumnWidth.html) property for the sheet to set the width for all columns in the sheet; use the [SetColumnWidth](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.SetColumnWidth.html) method or use the Column [Width](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Column.Width.html) property to set the width for a specific column. For row heights, set the [DefaultRowHeight](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.DefaultRowHeight.html) property for the sheet to set the height for all the rows in the sheet; use the [SetRowHeight](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.SetRowHeight.html) method or use the Row [Height](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Row.Height.html) property to set the height for a specific row.
Users can change the row height or column width by dragging the header lines between rows or columns.

## Using the Properties Window

1. To change the default column width setting or row height, at design time, in the **Properties** window, select the **Sheets** property for the FpSpread component.
2. Click the button to display the **SheetView Collection Editor**.
3. In the **Members** list, select the sheet for which to set the default column width or row height.
4. Select the **DefaultColumnWidth** property in the property list or the **DefaultRowHeight**, and specify the width or height in pixels.
5. Click **OK** to close the editor.
6. To change the width or height for a specific column or row, select the **Columns** or **Rows** collection after selecting the sheet. Then select a column or row and set the width or height properties.
7. Click **OK** to close the editor.

## Using Code

Typically, set the default column width for the sheet and set the width of individual columns on that sheet as needed. Similarly, set the default row height for the sheet and set the height of individual rows on that sheet as needed.
**Example**
This example code changes the default width of all columns for the first sheet to 50 pixels, but makes the width of the second column 100 pixels.

```csharp
// Set default width to 50, but second column 100.
FpSpread1.Sheets[0].DefaultColumnWidth = 50;
FpSpread1.Sheets[0].Columns[1].Width = 100;
```

```vbnet
' Set default width to 50, but second column 100.
FpSpread1.Sheets(0).DefaultColumnWidth = 50
FpSpread1.Sheets(0).Columns(1).Width = 100
```

## Using Code

Set the [Width](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Column.Width.html) property for a [Column](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Column.html) object.
**Example**
This example code sets the width of the second column to 100 pixels.

```csharp
FarPoint.Web.Spread.Column Col1;
Col1 = fpSpread1.Sheets[0].Columns[1];
Col1.Width = 100;
```

```vbnet
Dim Col1 As FarPoint.Web.Spread.Column
Col1 = FpSpread1.Sheets(0).Columns(1)
Col1.Width = 100
```

## Using the Spread Designer

1. To set the default column width or row height,
    1. Select the sheet for which you want to set the default column width or row height.
    2. Select **DefaultColumnWidth** or **DefaultRowHeight** and set the width or height properties.
    3. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.
2. To set a specific column width or row height,
    1. Select the column or row for which you want to change the width or height.
    2. In the properties list for that column or row, change the **Width** property or the **Height** property.
    3. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.