# SetColWidth

Use the SetColWidth method to set a column to a specified width. Learn its syntax and parameters in documentation.

## Content

Sets a column to a specified width.

## Syntax

[JavaScript]

```javascript
FpSpread1.setColWidth(column, width);
```

## Parameters

***column***
Integer, column index
***width***
Integer, number of pixels in width of column

## Return Type

None

## Remarks

This method sets the specified column to the specified width. The column index must be valid. The column index is zero-based, so the first column is 0. This method does not cause a postback to occur.
This method can be used to hide a column by setting the width to zero.

## Example

This example sets the width of the sixth column to 240 pixels. On the client side, the script that contains the method would look like this:

```javascript
<script type="text/javascript">
  function sizeColumn() {
    FpSpread1.setColWidth(5,240);
  }
</script>
```

## See Also

[SetValue](/spreadnet/docs/latest/online-asp/overview/spweb-clientscriptref/clientscript-members/clientscript-allmeths/CSSR-SetValue)
[Scripting Members](/spreadnet/docs/latest/online-asp/overview/spweb-clientscriptref/clientscript-members)