Column
Column class
Represents a single column in a worksheet.
Properties
| Name | Type | Description |
|---|---|---|
| Index | Number | Gets the index of this column. |
| Width | Number | Gets and sets the column width in unit of characters. For spreadsheet, column width is measured as the number of charact |
| GroupLevel | byte | Gets the group level of the column. |
| IsHidden | boolean | Indicates whether the column is hidden. |
| HasCustomStyle | boolean | Indicates whether this column has custom style settings(different from the default one inherited from workbook). |
| IsCollapsed | boolean | whether the column is collapsed |
Methods
| Name | Description |
|---|---|
| applyStyle | Applies formats for a whole column. |
| getStyle | Gets the style of this column. |
Modifying the returned style object directly takes no effect for this column or any cell | | setStyle | Sets the style of this column.
This method only sets the given style as the default style for this column, without chan |
Column.Index property
Gets the index of this column.
Type: Number
Column.Width property
Gets and sets the column width in unit of characters. For spreadsheet, column width is measured as the number of characters of the maximum digit width of the numbers 0~9 as rendered in the normal style’s font.
Type: Number
Column.GroupLevel property
Gets the group level of the column.
Type: byte
Column.IsHidden property
Indicates whether the column is hidden.
Type: boolean
Column.HasCustomStyle property
Indicates whether this column has custom style settings(different from the default one inherited from workbook).
Type: boolean
Column.IsCollapsed property
whether the column is collapsed
Type: boolean
applyStyle(style, flag)
Applies formats for a whole column.
| Parameter | Type | Description |
|---|---|---|
| style | Style | The style object which will be applied. |
| flag | StyleFlag | Flags which indicates applied formatting properties. |
getStyle()
Gets the style of this column.
Modifying the returned style object directly takes no effect for this column or any cells in this column. You have to call applyStyle(com.aspose.cells.Style, com.aspose.cells.StyleFlag) or setStyle(com.aspose.cells.Style) method to apply the change to this column. Column’s style is the style which will be inherited by cells in this column(those cells that have no custom style settings, such as existing cells that have not been set style explicitly, or those that have not been instantiated)
setStyle(style)
Sets the style of this column.
This method only sets the given style as the default style for this column, without changing the style settings for existing cells in this column. To update style settings of existing cells to the specified style at the same time, please use applyStyle(com.aspose.cells.Style, com.aspose.cells.StyleFlag)
| Parameter | Type | Description |
|---|---|---|
| style | Style | the style to be used as the default style for cells in this column. |