Back to Devexpress

Workbook.TableStyles Property

officefileapi-devexpress-dot-spreadsheet-dot-workbook-faab3156.md

latest3.7 KB
Original Source

Workbook.TableStyles Property

Provides access to the collection of styles to format tables in the workbook.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this property in production code.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public TableStyleCollection TableStyles { get; }
vb
Public ReadOnly Property TableStyles As TableStyleCollection

Property Value

TypeDescription
TableStyleCollection

A TableStyleCollection object containing table styles.

|

Remarks

The TableStyles property returns the collection of styles that you can apply to tables to change their appearance. An individual table style is specified by the TableStyle object. To apply a style to a table, assign the required table style object to the Table.Style property.

By default, a workbook’s collection of table styles contains Microsoft® Excel® built-in table styles that can be obtained by their ids (members of the BuiltInTableStyleId enumeration). Built-in table styles cannot be deleted or modified. However, you can create your own custom table styles, as well as duplicate, modify or delete them.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TableStyles property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

spreadsheet-document-api-examples-part2/CS/SpreadsheetDocServerAPIPart2/CodeExamples/TableActions.cs#L24

csharp
// Apply a built-in table style to the table.
table.Style = workbook.TableStyles[BuiltInTableStyleId.TableStyleMedium20];
#endregion #CreateTable

spreadsheet-document-api-examples-part2/VB/SpreadsheetDocServerAPIPart2/CodeExamples/TableActions.vb#L21

vb
' Apply a built-in table style to the table.
            table.Style = workbook.TableStyles(BuiltInTableStyleId.TableStyleMedium20)
' #End Region ' #CreateTable

Implements

TableStyles

See Also

Workbook Class

Workbook Members

DevExpress.Spreadsheet Namespace