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:
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 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.
Table Style 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:
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:
Table Style Options: First and Last Columns
Next, we’ll turn off banded rows, leave the Header as is and add the first column:
Here’s the table with First and Last Columns checked:
Table Style Options: Header and Total
And finally, 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 a similar 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. Sadly, the table style specs for the different parograms are dissferent, so it’s not possible to trasfer tables style OOXML among Word, Excel and PowerPoint.
Table Styles: What You Can’t Do
You cannot set vertical cell/row alignment or cell margins in default taxt table text or a table style. It would have been possible given the OOXML spec, but Microsoft just didn’t bother.
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 email@example.com
Can I just pay you to do this for me?
Sure, that’s what we’re here for!
Is there a way to align text in middle of the cells?
Yes, this is possible. My post on Default Table Text covers setting text alignment, along with typeface choice and size, and whether the font is bold or italic.
thanks, i found that. but i was thinking in the middle vertically in the cell.
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.
Hey, my company would be happy to pay for you to help us with creating custom table styles. Please contact me.
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! 😉
Glad you got it figured out!
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!
If you search GUID Generator, you’ll find several web pages that can create them for you.
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
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.
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:ln w=”0″ cmpd=”sng”>
<a:schemeClr val= “dk1″/>
I use a good editor. Any typing errors are probably caused by transferring the code to this site.
It’s noFill instead of solidFill to set the borders to 0 ?
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:
Is there any way to permanently add 1 more table style to the defautl gallery in powerpoint? And if so how? Also where in exactly is that gallery saved ( I’ve found the themes gallery in office16, but I can’t find the tables gallery in the office files)
I’ve done my best to format my tables according to the specs laid out here. They look great on-screen and native but whenever we PDF them, we get these thin hairlines and I’m not sure how to get rid of them. By default, it feels like borders are all turned on so we manually set the default ones to have a with of 0 but now I’m wondering if this is still a cause of them showing up in the PDFs. despite having a width of 0, is acrobat picking up and creating a near 0 line simply because a line is defined. is there a way to say that for a border/side of the cell, to turn the line OFF as opposed to setting it to be 0?
I looked for the proper code for this but can’t seem to find it but I’m wondering that if such a command exists if this would fix the PDF issue. To solve it now, I have to go to every table, create border lines where there shouldn’t be any, and then remove them, and then the resulting PDF is fine.
Any insight would be great. Thanks and happy thanksgiving!
In addition to setting the line width to 0, remove the line fill color:
Let me thank you for your work. You are the most knowledable on the internet I’ve seen for the subject of xml editing in Office. A question I had when trying to edit table styles via xml: it appears that, unlike the addition of an individual custom color using xml, or the addition of a palette of colors using the editor in the Variants->Colors menu of the Design tab, custom tables aren’t saved along with the theme when saving a .thmx file from the Design tab. If true, does that mean I have to start with my hand edited .pptx with its custom table themes every time I want to use them?
Thank you for any help
You are correct that tables styles are not saved in theme (thmx) files. To retain content like table styles, sample slides, and preformatted Notes and Handout masters, save the file as a template (potx) instead of a theme.
How do you turn on “banded columns” and turn off “banded rows” so it is a default when creating a table in PPTX in XML?
By default, PowerPoint has the options turned on for Header Row and Banded Rows, with all other options turned off. A table style alone can’t override those defaults. You would have to create an VBA add-in that captured table insertion operations to create a different behavior. Not a trivial task.