[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Expand]Spreadsheet Document API
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Collapse]API Reference
  [Expand]DevExpress.BarCodes
  [Expand]DevExpress.Compression
  [Expand]DevExpress.Docs.Text
  [Expand]DevExpress.Office
  [Expand]DevExpress.Office.Drawing
  [Expand]DevExpress.Office.Export
  [Expand]DevExpress.Office.Export.Html
  [Expand]DevExpress.Office.Import
  [Expand]DevExpress.Office.Localization
  [Expand]DevExpress.Office.Options
  [Expand]DevExpress.Office.Services
  [Expand]DevExpress.Office.Utils
  [Expand]DevExpress.Pdf
  [Expand]DevExpress.Pdf.Localization
  [Expand]DevExpress.Snap
  [Collapse]DevExpress.Spreadsheet
   [Expand]ActiveSheetChangedEventArgs Class
    ActiveSheetChangedEventHandler Delegate
   [Expand]ActiveSheetChangeEventArgsBase Class
   [Expand]ActiveSheetChangingEventArgs Class
    ActiveSheetChangingEventHandler Delegate
   [Expand]Alignment Interface
   [Expand]AreasCollection Interface
   [Expand]ArrayFormula Interface
   [Expand]ArrayFormulaCollection Interface
    ArrowheadSize Enumeration
    ArrowheadType Enumeration
   [Expand]ArrowSettings Interface
   [Expand]AutoFilterBase Interface
   [Expand]AutoFilterColumn Interface
   [Expand]AutoFilterColumnCollection Interface
   [Expand]AverageConditionalFormatting Interface
    BeforeExportEventHandler Delegate
    BeforeImportEventHandler Delegate
   [Expand]BeforePrintSheetEventArgs Class
    BeforePrintSheetEventHandler Delegate
   [Expand]Border Interface
    BorderLineStyle Enumeration
   [Expand]Borders Interface
    BuiltInStyleId Enumeration
    BuiltInTableStyleId Enumeration
    CalculationEngineType Enumeration
    CalculationMode Enumeration
   [Expand]CalculationOptions Interface
   [Expand]Cell Interface
   [Expand]CellCollection Interface
   [Expand]CellKey Structure
   [Expand]CellValue Class
    CellValueType Enumeration
   [Expand]ChartSheet Interface
   [Expand]ChartSheetCollection Interface
   [Expand]ChartSheetPrintOptions Interface
    ChartSheetProtection Enumeration
   [Expand]ChartSheetView Interface
   [Expand]ClipboardDataObtainedEventArgs Class
    ClipboardDataObtainedEventHandler Delegate
   [Expand]ClipboardDataPastedEventArgs Class
    ClipboardDataPastedEventHandler Delegate
    ClipboardDataPastingEventHandler Delegate
   [Expand]ColorScale2ConditionalFormatting Interface
   [Expand]ColorScale3ConditionalFormatting Interface
   [Expand]Column Interface
   [Expand]ColumnCollection Interface
   [Expand]ColumnsChangedEventArgs Class
   [Expand]ColumnsChangingEventArgs Class
    ColumnsInsertedEventHandler Delegate
    ColumnsRemovedEventHandler Delegate
   [Expand]Comment Interface
   [Expand]CommentChangedEventArgs Class
    CommentChangedEventHandler Delegate
   [Expand]CommentCollection Interface
   [Expand]CommentInsertingEventArgs Class
    CommentInsertingEventHandler Delegate
   [Expand]CommentRemovingEventArgs Class
    CommentRemovingEventHandler Delegate
   [Expand]CommentRun Interface
   [Expand]CommentRunCollection Interface
    CommentsPrintMode Enumeration
   [Expand]ConditionalFormatting Interface
    ConditionalFormattingAverageCondition Enumeration
   [Expand]ConditionalFormattingCollection Interface
   [Expand]ConditionalFormattingCustomIcon Structure
    ConditionalFormattingDataBarAxisPosition Enumeration
    ConditionalFormattingDataBarDirection Enumeration
    ConditionalFormattingExpressionCondition Enumeration
   [Expand]ConditionalFormattingExtremumValue Interface
   [Expand]ConditionalFormattingIconSetInsideValue Interface
   [Expand]ConditionalFormattingIconSetValue Interface
   [Expand]ConditionalFormattingInsideValue Interface
    ConditionalFormattingRangeCondition Enumeration
    ConditionalFormattingRankCondition Enumeration
    ConditionalFormattingSpecialCondition Enumeration
    ConditionalFormattingTextCondition Enumeration
    ConditionalFormattingTimePeriod Enumeration
   [Expand]ConditionalFormattingValue Interface
    ConditionalFormattingValueOperator Enumeration
    ConditionalFormattingValueType Enumeration
   [Expand]ConnectorFormat Interface
    ConnectorType Enumeration
   [Expand]CopiedRangePastedEventArgs Class
    CopiedRangePastedEventHandler Delegate
   [Expand]CopiedRangePastingEventArgs Class
    CopiedRangePastingEventHandler Delegate
   [Expand]CustomCellInplaceEditor Interface
   [Expand]CustomCellInplaceEditorCollection Interface
    CustomCellInplaceEditorType Enumeration
   [Expand]CustomFilter Interface
   [Expand]CustomXmlPartCollection Interface
   [Expand]DataBarConditionalFormatting Interface
    DataBindingDirection Enumeration
   [Expand]DataBindingErrorEventArgs Class
    DataBindingErrorEventHandler Delegate
    DataBindingErrorType Enumeration
   [Expand]DataImportOptions Class
    DataSourceEditingOptions Enumeration
   [Expand]DataSourceImportOptions Class
   [Expand]DataSourceOptionsBase Class
   [Expand]DataValidation Interface
   [Expand]DataValidationCollection Interface
    DataValidationErrorStyle Enumeration
    DataValidationImeMode Enumeration
    DataValidationOperator Enumeration
    DataValidationType Enumeration
   [Expand]DateGrouping Class
    DateTimeGroupingType Enumeration
   [Expand]DefinedName Interface
   [Expand]DefinedNameCollection Interface
   [Expand]DefinedNameConflictResolvingEventArgs Class
    DefinedNameConflictResolvingEventHandler Delegate
    DeleteMode Enumeration
    DiagonalBorderType Enumeration
   [Expand]DocumentCustomProperties Interface
   [Expand]DocumentFormat Structure
   [Expand]DocumentOptions Class
   [Expand]DocumentProperties Interface
    DocumentSecurity Enumeration
   [Expand]DocumentSettings Interface
    DynamicFilterType Enumeration
   [Expand]EditRangePermission Class
   [Expand]EncryptedFileIntegrityCheckFailedEventArgs Class
    EncryptedFileIntegrityCheckFailedEventHandler Delegate
   [Expand]EncryptedFilePasswordRequestEventArgs Class
    EncryptedFilePasswordRequestEventHandler Delegate
   [Expand]EncryptionOptions Interface
    EncryptionType Enumeration
    ErrorsPrintMode Enumeration
    ErrorType Enumeration
   [Expand]ErrorValueInfo Interface
   [Expand]ExpressionConditionalFormatting Interface
   [Expand]ExternalDataSourceOptions Class
   [Expand]ExternalDefinedName Interface
   [Expand]ExternalWorkbook Interface
   [Expand]ExternalWorkbookCollection Interface
   [Expand]ExternalWorksheet Interface
   [Expand]Fill Interface
    FillType Enumeration
    FilterComparisonOperator Enumeration
   [Expand]FilterCriteria Interface
    FilterType Enumeration
   [Expand]FilterValue Class
   [Expand]FloatingObject Interface
    FontSchemeStyles Enumeration
   [Expand]Formatting Interface
   [Expand]FormulaExpressionConditionalFormatting Interface
   [Expand]GradientFill Interface
    GradientFillType Enumeration
   [Expand]GradientStop Interface
   [Expand]GradientStopCollection Interface
   [Expand]HeaderFooterCode Class
   [Expand]HeaderFooterPicture Interface
    HeaderFooterSection Enumeration
   [Expand]Hyperlink Interface
   [Expand]HyperlinkBase Interface
   [Expand]HyperlinkCollection Interface
   [Expand]IBindingRangeValueConverter Interface
   [Expand]ICellValueConverter Interface
   [Expand]IClipboardManager Interface
   [Expand]IconSetConditionalFormatting Interface
    IconSetType Enumeration
   [Expand]ICustomXmlPart Interface
   [Expand]IDataSourceColumnTypeDetector Interface
   [Expand]IDataValueConverter Interface
   [Expand]IgnoredError Interface
   [Expand]IgnoredErrorCollection Interface
    IgnoredErrorType Enumeration
    InsertCellsMode Enumeration
    InvalidFormatExceptionEventHandler Delegate
   [Expand]IRangeProvider Interface
   [Expand]ISpreadsheetComponent Interface
   [Expand]ISupportsFormatting Interface
   [Expand]IUsedNameSet Interface
   [Expand]IWorkbook Interface
   [Expand]IWorkbookMergeResult Interface
   [Expand]Margins Interface
    MergeCellsMode Enumeration
   [Expand]PageBreaksCollection Interface
    PageOrder Enumeration
    PageOrientation Enumeration
   [Expand]PanesFrozenEventArgs Class
    PanesFrozenEventHandler Delegate
   [Expand]PanesUnfrozenEventArgs Class
    PanesUnfrozenEventHandler Delegate
   [Expand]Parameter Interface
   [Expand]ParametersCollection Interface
    PasteSpecial Enumeration
    PatternType Enumeration
   [Expand]Picture Interface
   [Expand]PictureCollection Interface
    PivotAxisType Enumeration
    PivotBaseItemType Enumeration
   [Expand]PivotBehaviorOptions Interface
   [Expand]PivotCache Interface
   [Expand]PivotCacheCollection Interface
    PivotCacheType Enumeration
   [Expand]PivotCalculatedFieldCollection Interface
   [Expand]PivotCalculatedItemCollection Interface
    PivotDataConsolidationFunction Enumeration
   [Expand]PivotDataField Interface
   [Expand]PivotDataFieldCollection Interface
   [Expand]PivotField Interface
   [Expand]PivotFieldBehaviorOptions Interface
   [Expand]PivotFieldCollection Interface
    PivotFieldGroupByType Enumeration
   [Expand]PivotFieldGroupingInfo Interface
   [Expand]PivotFieldLayout Interface
   [Expand]PivotFieldReference Interface
   [Expand]PivotFieldReferenceBase Interface
   [Expand]PivotFieldReferenceCollection Interface
   [Expand]PivotFieldSortOptions Interface
    PivotFieldSortType Enumeration
   [Expand]PivotFilter Interface
   [Expand]PivotFilterCollection Interface
    PivotFilterTop10Type Enumeration
    PivotFilterType Enumeration
   [Expand]PivotGroupingValue Class
   [Expand]PivotItem Interface
   [Expand]PivotItemCollection Interface
   [Expand]PivotItemReference Class
   [Expand]PivotLayout Interface
   [Expand]PivotLocation Interface
   [Expand]PivotPageField Interface
   [Expand]PivotPageFieldCollection Interface
    PivotPageOrder Enumeration
    PivotReportLayout Enumeration
    PivotShowValuesAsType Enumeration
    PivotSubtotalFunctions Enumeration
    PivotSubtotalType Enumeration
   [Expand]PivotTable Interface
   [Expand]PivotTableCollection Interface
   [Expand]PivotViewOptions Interface
    Placement Enumeration
   [Expand]ProtectedRange Interface
   [Expand]ProtectedRangeCollection Interface
   [Expand]Protection Interface
   [Expand]Range Interface
   [Expand]RangeConditionalFormatting Interface
   [Expand]RangeCopiedEventArgs Class
    RangeCopiedEventHandler Delegate
   [Expand]RangeCopyingEventArgs Class
    RangeCopyingEventHandler Delegate
   [Expand]RangeDataSourceOptions Class
   [Expand]RangeExtensions Class
   [Expand]RankConditionalFormatting Interface
   [Expand]RealTimeData Interface
    ReferenceElement Enumeration
    ReferenceStyle Enumeration
   [Expand]RichTextRange Interface
   [Expand]RichTextRun Interface
   [Expand]RichTextRunFont Class
   [Expand]RichTextString Class
   [Expand]Row Interface
   [Expand]RowCollection Interface
    RowFormatMode Enumeration
   [Expand]RowsChangedEventArgs Class
   [Expand]RowsChangingEventArgs Class
   [Expand]RowsColumnsChangingEventArgsBase Class
    RowsInsertedEventHandler Delegate
    RowsRemovedEventHandler Delegate
    ScriptType Enumeration
   [Expand]ScrollPositionChangedEventArgs Class
    SearchBy Enumeration
    SearchIn Enumeration
   [Expand]SearchOptions Class
   [Expand]Shape Interface
   [Expand]ShapeChangedEventArgs Class
   [Expand]ShapeChangingEventArgs Class
   [Expand]ShapeCollection Interface
   [Expand]ShapeFormatBase Interface
   [Expand]ShapeGeometry Interface
    ShapeGeometryPreset Enumeration
   [Expand]ShapeHyperlink Interface
   [Expand]ShapesCopyingEventArgs Class
    ShapesCopyingEventHandler Delegate
   [Expand]ShapeText Interface
    ShapeTextAutoSizeType Enumeration
    ShapeTextHorizontalAnchorType Enumeration
    ShapeTextHorizontalOverflowType Enumeration
    ShapeTextOrientationType Enumeration
    ShapeTextParagraphAlignment Enumeration
   [Expand]ShapeTextParagraphFormat Interface
   [Expand]ShapeTextRange Interface
    ShapeTextReadingOrderType Enumeration
    ShapeTextVerticalAnchorType Enumeration
    ShapeTextVerticalOverflowType Enumeration
    ShapeTextWarpFormat Enumeration
    ShapeType Enumeration
   [Expand]Sheet Interface
   [Expand]SheetAutoFilter Interface
   [Expand]SheetCollection Interface
   [Expand]SheetInsertedEventArgs Class
    SheetInsertedEventHandler Delegate
   [Expand]SheetRemovedEventArgs Class
    SheetRemovedEventHandler Delegate
   [Expand]SheetRemovingEventArgs Class
    SheetRemovingEventHandler Delegate
   [Expand]SheetRenamedEventArgs Class
    SheetRenamedEventHandler Delegate
   [Expand]SheetRenamingEventArgs Class
    SheetRenamingEventHandler Delegate
    SheetType Enumeration
   [Expand]SortCondition Class
   [Expand]SortField Class
   [Expand]SortState Interface
   [Expand]Sparkline Interface
    SparklineAxisScaling Enumeration
   [Expand]SparklineCollection Interface
   [Expand]SparklineColor Interface
   [Expand]SparklineGroup Interface
   [Expand]SparklineGroupCollection Interface
    SparklineGroupType Enumeration
   [Expand]SparklineHorizontalAxis Interface
   [Expand]SparklinePoints Interface
   [Expand]SparklineVerticalAxis Interface
   [Expand]SpecialConditionalFormatting Interface
   [Expand]SpreadsheetBeforeExportEventArgs Class
   [Expand]SpreadsheetBeforeImportEventArgs Class
   [Expand]SpreadsheetCustomAssemblyLoadingEventArgs Class
    SpreadsheetCustomAssemblyLoadingEventHandler Delegate
   [Expand]SpreadsheetFont Interface
   [Expand]SpreadsheetFontProperties Interface
    SpreadsheetFontStyle Enumeration
   [Expand]SpreadsheetHistory Interface
    SpreadsheetHorizontalAlignment Enumeration
   [Expand]SpreadsheetImageSource Class
   [Expand]SpreadsheetInvalidFormatExceptionEventArgs Class
   [Expand]SpreadsheetMailMergeOptions Interface
   [Expand]SpreadsheetValidateCustomSqlQueryEventArgs Class
    SpreadsheetValidateCustomSqlQueryEventHandler Delegate
    SpreadsheetVerticalAlignment Enumeration
   [Expand]Style Interface
   [Expand]StyleCollection Interface
   [Expand]StyleFlags Interface
   [Expand]Table Interface
   [Expand]TableAutoFilter Interface
   [Expand]TableCollection Interface
   [Expand]TableColumn Interface
   [Expand]TableColumnCollection Interface
   [Collapse]TableStyle Interface
     TableStyle Members
    [Expand]TableStyle Properties
    [Expand]TableStyle Methods
   [Expand]TableStyleCollection Interface
   [Expand]TableStyleElement Interface
   [Expand]TableStyleElements Interface
    TableStyleElementType Enumeration
   [Expand]TextConditionalFormatting Interface
   [Expand]TimePeriodConditionalFormatting Interface
    Top10Type Enumeration
    TotalRowFunction Enumeration
    UnderlineType Enumeration
   [Expand]ValueObject Class
   [Expand]Workbook Class
   [Expand]WorkbookExtensions Class
   [Expand]WorkbookMergeOptions Class
   [Expand]Worksheet Interface
   [Expand]WorksheetCollection Interface
   [Expand]WorksheetDataBinding Interface
   [Expand]WorksheetDataBindingCollection Interface
   [Expand]WorksheetExtensions Class
   [Expand]WorksheetHeaderFooter Interface
   [Expand]WorksheetHeaderFooterOptions Interface
   [Expand]WorksheetOutlineOptions Interface
   [Expand]WorksheetPageNumbering Interface
    WorksheetPageNumberingStartType Enumeration
   [Expand]WorksheetPrintOptions Interface
   [Expand]WorksheetPrintTitleOptions Interface
    WorksheetProtectionPermissions Enumeration
   [Expand]WorksheetTableDataBinding Interface
   [Expand]WorksheetView Interface
    WorksheetViewType Enumeration
    WorksheetVisibilityType Enumeration
    WorksheetZoomMode Enumeration
  [Expand]DevExpress.Spreadsheet.Charts
  [Expand]DevExpress.Spreadsheet.Drawings
  [Expand]DevExpress.Spreadsheet.Export
  [Expand]DevExpress.Spreadsheet.Formulas
  [Expand]DevExpress.Spreadsheet.Functions
  [Expand]DevExpress.UnitConversion
  [Expand]DevExpress.XtraPrinting
  [Expand]DevExpress.XtraPrintingLinks
  [Expand]DevExpress.XtraRichEdit
  [Expand]DevExpress.XtraRichEdit.API.Layout
  [Expand]DevExpress.XtraRichEdit.API.Native
  [Expand]DevExpress.XtraRichEdit.API.Native.Implementation
  [Expand]DevExpress.XtraRichEdit.Commands
  [Expand]DevExpress.XtraRichEdit.Export
  [Expand]DevExpress.XtraRichEdit.Export.Html
  [Expand]DevExpress.XtraRichEdit.Export.Rtf
  [Expand]DevExpress.XtraRichEdit.Forms
  [Expand]DevExpress.XtraRichEdit.Import
  [Expand]DevExpress.XtraRichEdit.Localization
  [Expand]DevExpress.XtraRichEdit.Services
  [Expand]DevExpress.XtraRichEdit.Utils
  [Expand]DevExpress.XtraSpreadsheet
  [Expand]DevExpress.XtraSpreadsheet.Export
  [Expand]DevExpress.XtraSpreadsheet.Export.Html
  [Expand]DevExpress.XtraSpreadsheet.Import
  [Expand]DevExpress.XtraSpreadsheet.Localization
  [Expand]DevExpress.XtraSpreadsheet.Services
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

TableStyle Interface

A named table or pivot table style.

Namespace:DevExpress.Spreadsheet
Assembly:DevExpress.Spreadsheet.v18.2.Core.dll

Expanded Syntax

Expanded Remarks

Table and pivot table styles are contained within the TableStyleCollection object accessible via the IWorkbook.TableStyles property. This collection includes a set of built-in styles (similar to Microsoft® Excel®) that can be obtained by the corresponding BuiltInTableStyleId or BuiltInPivotStyleId enumeration members and custom styles that can be accessed by their names (Name). Built-in styles are contained in the collection by default, while custom styles can be added via the TableStyleCollection.Add or Duplicate methods.

A table style consists of a collection of table style elements. These elements are stored in the TableStyleElements collection that is returned by the TableStyleElements property. Each table style element is represented by the TableStyleElement object and is accessed by the corresponding member of the TableStyleElementType enumeration. A TableStyleElement object provides the TableStyleElement.Borders, TableStyleElement.Fill and TableStyleElement.Font properties to specify the formatting for a particular element of a table. See the How to: Create, Modify and Delete Table Styles document for details.

To apply a style to a table, use the Table.Style property (see the How to: Apply a Table Style to a Table example). To apply a style to a pivot table, use the PivotTable.Style property (see the How to: Apply a Predefined Style to a Pivot Table example).

Expanded Example

To format a table by applying a table style, assign the corresponding TableStyle object to the Table.Style property. Access the required table style object from the IWorkbook.TableStyles collection by the table style name. Built-in table styles can also be obtained by their ids (the BuiltInTableStyleId enumeration members).

A table style consists of the collection of table style elements (TableStyleElements). Each table style element (TableStyleElement) specifies the formatting for a particular element of a table. The TableStyleElementType enumerator lists supported table style element types. The Table object provides the following properties to optionally specify table elements to be formatted as defined by the corresponding elements of the applied table style.

Property Description
Table.ShowHeaders Displays the header row in the table and formats it as specified by the TableStyleElementType.HeaderRow element of the applied table style.
Table.ShowTotals Display the total row in the table and formats it as specified by the TableStyleElementType.TotalRow element of the applied table style.
Table.ShowTableStyleRowStripes Applies striped row formatting to a table as specified by the TableStyleElementType.FirstRowStripe and TableStyleElementType.SecondRowStripe elements of the applied table style.
Table.ShowTableStyleColumnStripes applies striped column formatting to a table as specified by the TableStyleElementType.FirstColumnStripe and TableStyleElementType.SecondColumnStripe elements of the applied table style.
Table.ShowTableStyleFirstColumn Formats the first column of the table as specified by the TableStyleElementType.FirstColumn, TableStyleElementType.FirstHeaderCell and TableStyleElementType.FirstTotalCell elements of the applied table style.
Table.ShowTableStyleLastColumn Formats the last column of the table as specified by the TableStyleElementType.LastColumn, TableStyleElementType.LastHeaderCell and TableStyleElementType.LastTotalCell elements of the applied table style.

This example demonstrates how to access a table style by its name and apply it to an existing table. The Table.ShowHeaders and Table.ShowTotals properties are set to true to show the header and total row of the table.

The Table.ShowTableStyleRowStripes and Table.ShowTableStyleColumnStripes properties are used to apply the striped column formatting to the table.

Note

A complete sample project is available at https://github.com/DevExpress-Examples/how-to-format-tables-e4909

Expanded Inheritance Hierarchy

Expanded See Also

Is this topic helpful?​​​​​​​