Spread for ASP.NET 8.0 Product Documentation > Client-Side Scripting Reference > Scripting Members > Methods > SetColWidth |
Sets a column to a specified width.
[JavaScript]
FpSpread1.setColWidth(column, width);
None
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.
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 |
Copy Code
|
---|---|
<SCRIPT>
function sizeColumn() {
FpSpread1.setColWidth(5,240);
}
</SCRIPT>
|