Class CellStyle
Represents the visual styling properties for a spreadsheet cell, mapping directly to CSS-like attributes for UI rendering.
Inherited Members
Namespace: Syncfusion.Blazor.Spreadsheet
Assembly: Syncfusion.Blazor.Spreadsheet.dll
Syntax
public class CellStyle
Remarks
This class defines presentation-only styling for a spreadsheet cell. Use 6‑digit hex colors ("#RRGGBB"). String properties use CSS‑like keywords (e.g., "bold", "italic", "center"); numeric font weights (e.g., "700") are also accepted.
Constructors
CellStyle()
Declaration
public CellStyle()
Properties
BackgroundColor
Gets the cell's background (fill) color.
Declaration
[JsonPropertyName("backgroundColor")]
public string BackgroundColor { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string containing a standard hex color code in "#RRGGBB" format. |
Color
Gets the color of the cell's text (foreground).
Declaration
[JsonPropertyName("color")]
public string Color { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string containing a standard hex color code in "#RRGGBB" format. |
FontFamily
Gets the name of the font used for the cell's text.
Declaration
[JsonPropertyName("fontFamily")]
public string FontFamily { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string representing a font family, such as "Segoe UI" or "Arial". |
FontSize
Gets the size of the font, including its unit.
Declaration
[JsonPropertyName("fontSize")]
public string FontSize { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string that specifies the font size, such as "12pt" or "14px". |
FontStyle
Gets the style of the font.
Declaration
[JsonPropertyName("fontStyle")]
public string FontStyle { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string indicating the font style, typically "normal" or "italic". |
FontWeight
Gets the thickness of the font characters.
Declaration
[JsonPropertyName("fontWeight")]
public string FontWeight { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string indicating the font weight, typically "normal" or "bold". |
TextAlign
Gets the horizontal alignment of the text within the cell.
Declaration
[JsonPropertyName("textAlign")]
public string TextAlign { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string specifying horizontal alignment: "left", "center", "right". |
TextDecoration
Gets the line decorations applied to the cell's text, such as underline or strikethrough.
Declaration
[JsonPropertyName("textDecoration")]
public string TextDecoration { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string specifying text decorations, like "underline", "line-through", or a combination such as "underline line-through". |
VerticalAlign
Gets the vertical alignment of the text within the cell.
Declaration
[JsonPropertyName("verticalAlign")]
public string VerticalAlign { get; init; }
Property Value
| Type | Description |
|---|---|
| string | A string specifying vertical alignment: "top", "middle", or "bottom". |