ListObject.TableStyle Property


Gets or sets the table style.

Namespace:   Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

object TableStyle { get; set; }

Property Value

Type: System.Object

An object that represents the table style.

The following code example adds a ListObject to the Sheet1 sheet. The example then sets the table style of the ListObject, which corresponds to an Excel table, to the Table Style Dark 10 style. The table styles you can set for this property correspond to the table styles that are available in the Excel user interface on the Design tab that appears when a table is selected.

This example is for a document-level customization.

private void SetListObjectStyle()
    Microsoft.Office.Tools.Excel.ListObject myTable = 
            Globals.Sheet1.Range["A1", "B3"], "myTable");

    myTable.TableStyle = "TableStyleDark10";
Return to top