# Customizing the Style of Header Cells

Learn how to customize the style of header cells and enhance the appearance of your spreadsheets with this comprehensive guide.

## Content

You can customize the style of header cells if you want to change the default appearance. You can set or customize many features, including:

* style properties of the header classes
* members of the renderers
* properties of the default header classes

To customize style properties for the header classes, set the default style of the header cells by setting the [DefaultStyle](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.DefaultStyle.html) property of the [RowHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.html) or the [DefaultStyle](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.DefaultStyle.html) property of the [ColumnHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.html). For more information on what can be set, refer to the [StyleInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.StyleInfo.html) object and the [RowHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.html) and [ColumnHeader](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.html) objects.
**Before**
![image](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/image.718a49.png)
**After**
![image](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/image.5f0c8d.png)
To customize using the renderers, set their members to customize the appearance of headers. The renderers used in the Office2013 or Office 2016 style are shown and listed in the following figure.
![Header renderers](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/hdr-renderers.png)
You can also use default classes to customize many of the header appearance properties by setting the properties of the [Columns.DefaultColumn](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Columns.DefaultColumn.html) class and the [Rows.DefaultRow](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Rows.DefaultRow.html) class.
You can also set the grid lines around the header cells to change the three-dimensional appearance. Refer to [Customizing the Header Grid Lines](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergridlines).
You can also add gradients to the header cells. Refer to [Adding a Gradient to Header Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergradient).

## Method to set

1. To change the style for the column header, define a style and then set the ColumnHeader object [DefaultStyle](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ColumnHeader.DefaultStyle.html) property.
2. To change the settings for the row header, define a style and then set the RowHeader object [DefaultStyle](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.RowHeader.DefaultStyle.html) property.

## Example

This example code defines a style with new colors and applies it to the column header as shown in the figure in this topic.

```csharp
fpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off;
// Define a new style.
FarPoint.Win.Spread.StyleInfo darkstyle = new FarPoint.Win.Spread.StyleInfo();
darkstyle.BackColor = Color.Teal;
darkstyle.ForeColor = Color.Yellow;
// Apply the new style to the column header of a sheet.
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = darkstyle;
```

```vbnet
fpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off
' Define a new style.
Dim darkstyle As New FarPoint.Win.Spread.StyleInfo()
darkstyle.BackColor = Color.Teal
darkstyle.ForeColor = Color.Yellow
' Apply the new style to the column header of a sheet.
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = darkstyle
```

## See Also

[Customizing the Header Grid Lines](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergridlines)
[Adding a Gradient to Header Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergradient)
[Customizing the Header Grid Lines](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergridlines)
[Adding a Gradient to Header Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-ssobject-header/spwin-appearheader/spwin-headergradient)