Class TableStyle
Style information for a specific table instance.
Inheritance
Namespace: IronXL.Styles
Assembly: IronXL.dll
Syntax
public class TableStyle : Object
The banded look of an Excel named table comes from TableStyle. When a range is saved as a named table, this type decides which banner of stripes, header emphasis, and column highlighting Excel paints over the data. A developer building a report or an exported dataset reaches for it to make a plain block of cells read as a real Excel table rather than loose values.
TableStyle is supplied to Range.SaveAsNamedTable, the call that promotes a selected range into a named table on the worksheet. The argument is optional, so a table can be created with the workbook default, or styled by passing one of the built-in presets that mirror Excel's own gallery. The style travels with the table once it is written, so the choice made here is what a user sees when the file is opened.
The presets are exposed as static fields named after Excel's three families: light, medium, and dark, each numbered (TableStyleLight1, TableStyleMedium2, TableStyleDark3, and so on), with None for an unstyled table. Pass one of these fields straight into SaveAsNamedTable rather than constructing a style by hand. The instance properties tune the banding on top of the chosen preset: ShowRowStripes and ShowColumnStripes toggle the alternating bands, while ShowFirstColumn and ShowLastColumn emphasize the leading and trailing columns, and Name reports the underlying style identifier. The stripe and emphasis flags are nullable, so an unset flag defers to the preset's own default instead of forcing a value. The same presets and flags map directly onto the table styling a user would pick from Excel's ribbon, which keeps a generated table consistent with what the audience expects to see.
using IronXL;
WorkBook workbook = WorkBook.Create();
WorkSheet sheet = workbook.DefaultWorkSheet;
sheet["A1:C4"].SaveAsNamedTable("Sales", true, TableStyle.TableStyleMedium2, true);The named table how-to walks through creating a styled table, the style cells, borders, and fonts example shows the wider formatting surface that surrounds it, and the border and alignment how-to covers per-cell styling for tables that need finer control.
Constructors
TableStyle()
Declaration
public TableStyle()
Fields
None
No built-in style.
Declaration
public static readonly TableStyle None
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark1
'TableStyleDark1' built-in style.
Declaration
public static readonly TableStyle TableStyleDark1
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark10
'TableStyleDark10' built-in style.
Declaration
public static readonly TableStyle TableStyleDark10
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark11
'TableStyleDark11' built-in style.
Declaration
public static readonly TableStyle TableStyleDark11
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark2
'TableStyleDark2' built-in style.
Declaration
public static readonly TableStyle TableStyleDark2
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark3
'TableStyleDark3' built-in style.
Declaration
public static readonly TableStyle TableStyleDark3
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark4
'TableStyleDark4' built-in style.
Declaration
public static readonly TableStyle TableStyleDark4
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark5
'TableStyleDark5' built-in style.
Declaration
public static readonly TableStyle TableStyleDark5
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark6
'TableStyleDark6' built-in style.
Declaration
public static readonly TableStyle TableStyleDark6
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark7
'TableStyleDark7' built-in style.
Declaration
public static readonly TableStyle TableStyleDark7
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark8
'TableStyleDark8' built-in style.
Declaration
public static readonly TableStyle TableStyleDark8
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleDark9
'TableStyleDark9' built-in style.
Declaration
public static readonly TableStyle TableStyleDark9
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight1
'TableStyleLight1' built-in style.
Declaration
public static readonly TableStyle TableStyleLight1
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight10
'TableStyleLight10' built-in style.
Declaration
public static readonly TableStyle TableStyleLight10
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight11
'TableStyleLight11' built-in style.
Declaration
public static readonly TableStyle TableStyleLight11
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight12
'TableStyleLight12' built-in style.
Declaration
public static readonly TableStyle TableStyleLight12
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight13
'TableStyleLight13' built-in style.
Declaration
public static readonly TableStyle TableStyleLight13
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight14
'TableStyleLight14' built-in style.
Declaration
public static readonly TableStyle TableStyleLight14
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight15
'TableStyleLight15' built-in style.
Declaration
public static readonly TableStyle TableStyleLight15
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight16
'TableStyleLight16' built-in style.
Declaration
public static readonly TableStyle TableStyleLight16
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight17
'TableStyleLight17' built-in style.
Declaration
public static readonly TableStyle TableStyleLight17
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight18
'TableStyleLight18' built-in style.
Declaration
public static readonly TableStyle TableStyleLight18
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight19
'TableStyleLight19' built-in style.
Declaration
public static readonly TableStyle TableStyleLight19
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight2
'TableStyleLight2' built-in style.
Declaration
public static readonly TableStyle TableStyleLight2
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight20
'TableStyleLight20' built-in style.
Declaration
public static readonly TableStyle TableStyleLight20
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight21
'TableStyleLight21' built-in style.
Declaration
public static readonly TableStyle TableStyleLight21
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight3
'TableStyleLight3' built-in style.
Declaration
public static readonly TableStyle TableStyleLight3
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight4
'TableStyleLight4' built-in style.
Declaration
public static readonly TableStyle TableStyleLight4
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight5
'TableStyleLight5' built-in style.
Declaration
public static readonly TableStyle TableStyleLight5
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight6
'TableStyleLight6' built-in style.
Declaration
public static readonly TableStyle TableStyleLight6
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight7
'TableStyleLight7' built-in style.
Declaration
public static readonly TableStyle TableStyleLight7
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight8
'TableStyleLight8' built-in style.
Declaration
public static readonly TableStyle TableStyleLight8
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleLight9
'TableStyleLight9' built-in style.
Declaration
public static readonly TableStyle TableStyleLight9
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium1
'TableStyleMedium1' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium1
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium10
'TableStyleMedium10' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium10
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium11
'TableStyleMedium11' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium11
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium12
'TableStyleMedium12' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium12
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium13
'TableStyleMedium13' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium13
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium14
'TableStyleMedium14' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium14
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium15
'TableStyleMedium15' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium15
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium16
'TableStyleMedium16' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium16
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium17
'TableStyleMedium17' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium17
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium18
'TableStyleMedium18' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium18
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium19
'TableStyleMedium19' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium19
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium2
'TableStyleMedium2' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium2
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium20
'TableStyleMedium20' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium20
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium21
'TableStyleMedium21' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium21
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium22
'TableStyleMedium22' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium22
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium23
'TableStyleMedium23' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium23
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium24
'TableStyleMedium24' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium24
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium25
'TableStyleMedium25' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium25
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium26
'TableStyleMedium26' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium26
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium27
'TableStyleMedium27' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium27
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium28
'TableStyleMedium28' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium28
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium3
'TableStyleMedium3' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium3
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium4
'TableStyleMedium4' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium4
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium5
'TableStyleMedium5' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium5
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium6
'TableStyleMedium6' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium6
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium7
'TableStyleMedium7' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium7
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium8
'TableStyleMedium8' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium8
Field Value
| Type | Description |
|---|---|
| TableStyle |
TableStyleMedium9
'TableStyleMedium9' built-in style.
Declaration
public static readonly TableStyle TableStyleMedium9
Field Value
| Type | Description |
|---|---|
| TableStyle |
Properties
Name
Gets or sets the name of the style (may reference a built-in style).
Declaration
public virtual string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ShowColumnStripes
true if alternating column styles should be applied.
Declaration
public virtual Nullable<bool> ShowColumnStripes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
ShowFirstColumn
true if the distinct first column style should be applied.
Declaration
public virtual Nullable<bool> ShowFirstColumn { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
ShowLastColumn
true if the distinct last column style should be applied.
Declaration
public virtual Nullable<bool> ShowLastColumn { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
ShowRowStripes
true if alternating row styles should be applied.
Declaration
public virtual Nullable<bool> ShowRowStripes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |