Exploring Table Markup in Open XML SpreadsheetML

Return to the SpreadsheetML Screen-Cast SeriesTables are a convenient and useful feature of Open XML SpreadsheetML. This post explores table markup, and links to a screen-cast that shows how to create a table programmatically.

The table feature has been part of Excel for some time; most users are familiar with tables. When you convert cells to a table in a spreadsheet, instead of seeing ordinary cells, you see a block of cells that have interesting characteristics. You can sort the table by clicking on the down-arrow in the column heading. You can insert rows in the table, and the rows become part of that table automatically. The banded colors make it easy to read.

It is pretty easy to create a table in Open XML SpreadsheetML. If you have some ordinary cells that have the data that you want to use to create the table, you need to do the following:

The following screen-cast walks through the process of discovering the markup necessary to convert some cells to a table, and shows creating a small Open XML SDK example to convert some ordinary cells into a table.

Download: Example that contains the finished result of the screen-cast.