Class SheetCell
A cell of a Sheet in a TwSpreadsheet workbook: what was typed into it and how it is formatted.
[ExcludeFromCodeCoverage]
public sealed class SheetCell
- Inheritance
-
SheetCell
- Inherited Members
Constructors
SheetCell()
public SheetCell()
Properties
Alignment
Gets or sets how the content lines up across the cell. Defaults to General.
public SheetCellAlignment Alignment { get; set; }
Property Value
Background
Gets or sets the cell's fill as a hex colour, such as #FEF3C7, or null for none.
public string? Background { get; set; }
Property Value
Remarks
Only hex colours (#RGB, #RRGGBB or #RRGGBBAA) are drawn; anything else is
ignored. Pick a fill that keeps the 4.5:1 contrast ratio with the text.
Bold
Gets or sets whether the cell's text is bold.
public bool Bold { get; set; }
Property Value
Color
Gets or sets the colour of the cell's text as a hex colour, such as #B91C1C, or null
for the theme's text colour.
public string? Color { get; set; }
Property Value
Remarks
Only hex colours are drawn; anything else is ignored.
FontFamily
Gets or sets the font family of the cell's text, such as Georgia, or null for the
theme's font.
public string? FontFamily { get; set; }
Property Value
Remarks
Letters, digits, spaces, hyphens, commas and quotes are allowed; anything else is ignored.
FontSize
Gets or sets the size of the cell's text in points, such as 14, or null for the
theme's size. Sizes are kept between 6 and 72.
public double? FontSize { get; set; }
Property Value
Format
Gets or sets how a number in the cell is shown. Defaults to General.
public SheetNumberFormat Format { get; set; }
Property Value
Italic
Gets or sets whether the cell's text is italic.
public bool Italic { get; set; }
Property Value
Underline
Gets or sets whether the cell's text is underlined.
public bool Underline { get; set; }
Property Value
Value
Gets or sets what was typed into the cell: a number such as 42 or 12.5%, TRUE or
FALSE, a formula starting with = such as =SUM(A1:A3), or text. Text that starts with an
apostrophe, such as '0123, is kept as text without the apostrophe.
public string? Value { get; set; }