OOXML Hacking: Table Styles Complete

Custom Table Styles are probably one of the more detailed hacks you’ll have to write. See the constructions details in my previous post. Besides the basic table format, there are 6 optional format layers you need to at least consider. In a minimal table style, you’ll need to include at least the Header Row, First Column and Banded Rows. Most users will expect to see these options. Total Rows, Last Columns and Banded Columns are less requested, you only need to include them if a design or client specifically requires them.

As mentioned in part 1, if you haven’t hacked XML before, please read XML Hacking: An Introduction. If you’re using a Mac, you should also read XML Hacking: Editing in OS X. In addition, an essential companion to this pair of articles is the post on setting Default Table Text, which is set in a different XML component..

Let’s take a look at how our work appears in the PowerPoint interface. First, we’ll insert a plain vanilla table. By default this takes on colors and fonts from the current PowerPoint theme:

Default Table Style

Next, we choose the Table Tools>Design tab, open the Table Styles gallery. Up at the top a new Custom section has appeared with our new custom table style:

Select Custom Table Style

Select the custom table style and the default table changes to match our design. This screen shot has all formatting options turned off, so effectively we are seeing the Whole Table formatting only.

All Options Off

Options: Banded Rows and Header

Using the options panel in the upper left corner, we can add some of optional formatting layers we created in XML. First, let’s turn on banded rows. If you remember, we only formatted odd-numbered rows, so the banding only changes rows 1 and 3 in our example:

Banded Rows

Next, we’ll leave banded rows on and also add the Header row. This row doesn’t count as part of the table body, so the banding moves down 1 row:

Banded Rows and Header

Options: First and Last Columns

Next, we’ll turn off banded rows, leave the Header as is and add the first column:

Header Row and First Column

Here’s the table with First and Last Columns checked:

First and Last Columns

Options: Header and Total

And finally, Header and Total Rows:

Header and Total Rows

As you can see, with some pre-planning, one table style can cover quite a few related table looks. The layer options for different features make the table useful for many different purposes and the options panel makes it fast and easy for users to try different combinations. This feature is a major advance over tables in PowerPoint 2003 and earlier, which were quite crude by comparison.Table styles work the same way in Word, PowerPoint and Excel. While Word and Excel include table style editors in their interface, PowerPoint needs to be hacked to create them. Happy hacking!

Of course, if the process is too complex, we’re here to help. The current price on a custom table style is US$120. Just email me production@brandwares.com

12:04 am

18 thoughts on “OOXML Hacking: Table Styles Complete

    • There is a fontAlgn parameter that does vertical text alignment, but unfortunately it does nothing in a table style. It’s only added when the user sets the vertical alignment after creating a table from a style.

  1. Any reason why my custom table shows a generic icon instead of the standard (responsive?) one you have showing here?

    • To be honest, I don’t think I’ve seen that before. Please send a screen shot of what you are seeing to production at brandwares dot com. Thanks!

      • Actually, I was reading some of the comments here and acted on: adding the « noFill » tag, when I had set my borders to 0. This, I believe, cured my problem. I can now see the dynamic representation of my table in the Quick Access Bar instead of a generic one with the running timer icon on top of it.
        Thanks anyway! 😉

  2. so i’ve been reading your pages for a few years now and every Nov-Dec, I review them when I try to clean up/make our ppt templates better for the next year. One thing i’ve never figured out is how/where I can generate a table ID. Is this important? can it just be a random string? in my templates are 3 legacy tables styles I’ve modified from year to year but this year i want to add additional options but can’t seem to figure how to get these IDs. If I make one up, it seems to invalidate my PPT file after I re-zip it. Any help would be great!

    EXAMPLE: styleId=”{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}”

  3. Hello, John,
    does this also work in PowerPoint 2010?

    In the newer versions (16 and newer and Mac 2011) I have no problems but in 2010 the xml is not recognized.
    Is there a difference in the interpretation of xml

    Thanks
    Don

    • The XML is exactly the same for all versions, Windows and Mac. Newer versions of Office add extra XML tags for new features, but the basic table style XML has not changed.

      • Hello, John,

        I want a table with horizontal lines only. I have set the corresponding lines to W=0.
        Unfortunately W=0 does not work in PowerPoint 2010. Is there another solution for “no line” ?
        (It works fine in 2011/2016/2019)

        Here is an excerpt. (

        <a:tcBdr>
        <a:left>
        <a:ln w=”0″ cmpd=”sng”>
        <a:solidFill>
        <a:schemeClr val= “dk1″/>

        I use a good editor. Any typing errors are probably caused by transferring the code to this site.

        Thanks,
        Don

          • You can set the fill to noFill, or you can simply delete the entire section. Here is the wholeTbl section that only has rules for inside vertical borders:

            <a:wholeTbl>
              <a:tcTxStyle>
                <a:fontRef idx="minor">
                  <a:prstClr val="black"/>
                </a:fontRef>
                <a:schemeClr val="dk1"/>
              </a:tcTxStyle>
              <a:tcStyle>
                <a:tcBdr>
                  <a:insideV>
                    <a:ln w="6350" cmpd="sng">
                      <a:solidFill>
                        <a:srgbClr val="9AA4AF"/>
                      </a:solidFill>
                    </a:ln>
                  </a:insideV>
                </a:tcBdr>
              </a:tcStyle>
            </a:wholeTbl>

Leave a Reply

*Required fields. Your email address will not be published.

Posting XML? To enter XML code, please replace all less than signs "<" with "&lt;" and greater than signs ">" with "&gt;". Otherwise, Wordpress will strip them out and you will see only a blank area where your code would have appeared.