{"id":2361,"date":"2016-03-02T00:51:03","date_gmt":"2016-03-02T00:51:03","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?page_id=2361"},"modified":"2016-03-02T00:58:39","modified_gmt":"2016-03-02T00:58:39","slug":"exploring-table-markup-in-open-xml-spreadsheetml","status":"publish","type":"page","link":"https:\/\/www.ericwhite.com\/blog\/exploring-table-markup-in-open-xml-spreadsheetml\/","title":{"rendered":"Exploring Table Markup in Open XML SpreadsheetML"},"content":{"rendered":"<p><span class=\"Back\"><a class=\"Back\" href=\"https:\/\/www.ericwhite.com\/blog\/introduction-to-spreadsheetml-series\/\">Return to the SpreadsheetML Screen-Cast Series<\/a><\/span>Tables 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.<\/p>\n<p>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.<\/p>\n<p>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:<\/p>\n<ul>\n<li>In the worksheet, you need to add a x:tableParts element that specifies a relationship to a table part.\n<p>&lt;x:tableParts\u00a0count=&#8221;1&#8243;&gt;<br \/>\n&lt;x:tablePart\u00a0r:id=&#8221;rId1&#8243;\u00a0\/&gt;<br \/>\n&lt;\/x:tableParts&gt;<\/p>\n<\/li>\n<li>You need to create a table part that has the appropriate elements and attributes to define the table.<\/li>\n<li>If the table has special formatting, you need to define the formatting in the x:dxfs element in the Styles part.<\/li>\n<\/ul>\n<p>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.<\/p>\n<p>Download: <a href=\"https:\/\/www.ericwhite.com\/blog\/wp-content\/uploads\/2016\/03\/ConvertCellsToTable.zip\" rel=\"\">Example that contains the finished result of the screen-cast.<\/a><\/p>\n<p><iframe loading=\"lazy\" title=\"ExcelTablesScreencast.wmv\" width=\"500\" height=\"375\" src=\"https:\/\/www.youtube.com\/embed\/6B_8K9SHTbw?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_s2mail":"","footnotes":""},"class_list":["post-2361","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/comments?post=2361"}],"version-history":[{"count":5,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2361\/revisions"}],"predecessor-version":[{"id":2367,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2361\/revisions\/2367"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=2361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}