Enum TableStyleType

TableStyleType enumeration

Represents the built-in table style type.

public enum TableStyleType

Values

NameValueDescription
None0
TableStyleLight11
TableStyleLight22
TableStyleLight33
TableStyleLight44
TableStyleLight55
TableStyleLight66
TableStyleLight77
TableStyleLight88
TableStyleLight99
TableStyleLight1010
TableStyleLight1111
TableStyleLight1212
TableStyleLight1313
TableStyleLight1414
TableStyleLight1515
TableStyleLight1616
TableStyleLight1717
TableStyleLight1818
TableStyleLight1919
TableStyleLight2020
TableStyleLight2121
TableStyleMedium122
TableStyleMedium223
TableStyleMedium324
TableStyleMedium425
TableStyleMedium526
TableStyleMedium627
TableStyleMedium728
TableStyleMedium829
TableStyleMedium930
TableStyleMedium1031
TableStyleMedium1132
TableStyleMedium1233
TableStyleMedium1334
TableStyleMedium1435
TableStyleMedium1536
TableStyleMedium1637
TableStyleMedium1738
TableStyleMedium1839
TableStyleMedium1940
TableStyleMedium2041
TableStyleMedium2142
TableStyleMedium2243
TableStyleMedium2344
TableStyleMedium2445
TableStyleMedium2546
TableStyleMedium2647
TableStyleMedium2748
TableStyleMedium2849
TableStyleDark150
TableStyleDark251
TableStyleDark352
TableStyleDark453
TableStyleDark554
TableStyleDark655
TableStyleDark756
TableStyleDark857
TableStyleDark958
TableStyleDark1059
TableStyleDark1160
Custom61

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Tables;
    using System;

    public class TableStyleTypeDemo
    {
        public static void TableStyleTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();

            // Add a new worksheet to the workbook
            Worksheet worksheet = workbook.Worksheets[0];

            // Add sample data to the worksheet
            worksheet.Cells["A1"].PutValue("Name");
            worksheet.Cells["A2"].PutValue("John");
            worksheet.Cells["A3"].PutValue("Jane");
            worksheet.Cells["A4"].PutValue("Doe");

            worksheet.Cells["B1"].PutValue("Age");
            worksheet.Cells["B2"].PutValue(30);
            worksheet.Cells["B3"].PutValue(25);
            worksheet.Cells["B4"].PutValue(35);

            // Create a ListObject (table) in the worksheet
            int listObjectIndex = worksheet.ListObjects.Add(1, 0, 4, 1, true);
            ListObject listObject = worksheet.ListObjects[listObjectIndex];

            // Set the table style type
            listObject.TableStyleType = TableStyleType.TableStyleMedium2;

            // Set additional properties for the table
            listObject.ShowHeaderRow = true;
            listObject.ShowTotals = true;
            listObject.ShowTableStyleFirstColumn = true;
            listObject.ShowTableStyleLastColumn = true;
            listObject.ShowTableStyleRowStripes = true;
            listObject.ShowTableStyleColumnStripes = true;

            // Save the workbook
            workbook.Save("TableStyleTypeExample.xlsx");

            // Output the table style type
            Console.WriteLine("Table Style Type: " + listObject.TableStyleType);
        }
    }
}

See Also