# ExcelStyleDefinition

Declares a complete cell style based on the workbook's Normal style, without requiring a source cell.

Class 

`OfficeIMO.Excel`

**Namespace**

`OfficeIMO.Excel`

**Assembly**

`OfficeIMO.Excel`

**Source revision**

`139dd4412592` with working tree changes

**Source**

[ExcelStyleDefinition.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L10)

**Modifiers**

sealed

Declares a complete cell style based on the workbook's Normal style, without requiring a source cell. Definitions are copied when a named style or tabular export is created.

## Inheritance

- object
- ExcelStyleDefinition

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 1

- Property [ExcelWriterOptions.Styles](/api/excel/officeimo-excel-excelwriteroptions/#property-styles)

### Accepted by parameters 1

- Method [ExcelDocument.DefineNamedStyle](/api/excel/officeimo-excel-exceldocument/#method-definenamedstyle-string-officeimo-excel-excelstyledefinition-boolean) parameter `definition`

Filter members 

Show inherited

## Constructors

`public ExcelStyleDefinition()` [#](#constructor-ctor)

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public bool Bold { get; set; }` [#](#property-bold)

[ExcelStyleDefinition.cs:10](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L10)

Displays text in bold.

`public bool Italic { get; set; }` [#](#property-italic)

[ExcelStyleDefinition.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L12)

Displays text in italics.

`public ExcelUnderlineStyle? Underline { get; set; }` [#](#property-underline)

[ExcelStyleDefinition.cs:14](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L14)

Optional underline treatment.

`public string? FontFamily { get; set; }` [#](#property-fontfamily)

[ExcelStyleDefinition.cs:16](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L16)

Optional font family; null keeps the Normal font.

`public OfficeLength? FontSize { get; set; }` [#](#property-fontsize)

[ExcelStyleDefinition.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L18)

Optional positive physical font size; null keeps the Normal font size.

`public OfficeColor? Color { get; set; }` [#](#property-color)

[ExcelStyleDefinition.cs:20](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L20)

Optional font color.

`public OfficeColor? BackgroundColor { get; set; }` [#](#property-backgroundcolor)

[ExcelStyleDefinition.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L22)

Optional solid background color.

`public bool WrapText { get; set; }` [#](#property-wraptext)

[ExcelStyleDefinition.cs:24](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L24)

Wraps text within the cell.

`public ExcelHorizontalAlignment? HorizontalAlignment { get; set; }` [#](#property-horizontalalignment)

[ExcelStyleDefinition.cs:26](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L26)

Optional horizontal alignment.

`public ExcelVerticalAlignment? VerticalAlignment { get; set; }` [#](#property-verticalalignment)

[ExcelStyleDefinition.cs:28](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L28)

Optional vertical alignment.

`public string? NumberFormat { get; set; }` [#](#property-numberformat)

[ExcelStyleDefinition.cs:33](https://github.com/EvotecIT/OfficeIMO/blob/139dd441259265c75d67971afe085c8680e944f6/OfficeIMO.Excel/ExcelStyleDefinition.cs#L33)

Optional Excel number-format code. Null allows tabular writers to select a temporal format for dates and durations while preserving the other declared properties.

<!-- PowerForge markdown artifact sha256:8E4FED843E6250D3F5DF2198635C8BA545C42D2492A19F9D8D1CCAC059C526D6 -->
