OOXML Hacking: Custom Table Styles

For branded documents, you want to have a unique table style. Microsoft Office programs include a pile of table styles that are auto-created by the software, but they all have that generic MS look. It’s possible to create custom styles in Excel and Word for both Windows and Mac using the program interface. But if you’re using PowerPopint, you can still create custom table styles. You just have to hack some XML!

First we have to cover how Office programs create custom tables. It’s not a simple subject, but understanding this will also help you if you’re trying to create custom table styles in Word for Windows or Excel, which actually have tools to do this in the respective programs.

Let’s start by making one thing clear: table styles do not format the font choice or size contained in the tables. Yes, I know the Word and Excel table style tools have font formatting dropdowns, yes I know Microsoft help files say that font styling is included in table styles. The truth is that font styling in a table style is limited to setting bold or italic attributes, font color and whether the table component uses the Headings or Body font as specced in the Font Theme. For typeface and size, alignment and weight/italic controls, read my post on Default Table Text

I find that it’s easier to format Office tables if I imagine that table formatting has layers. The base layer is any overall formatting that applies to the table as a whole. Then, we build layers on top of that base formatting that looks after the Header Row, probably the most common feature applied to tables. We follow this with the Total Row, the bottom one. Next, the First and Last Columns. Once these outer areas are formatted, we add layers for Even and Odd Row Banding and then Even and Odd Column Banding. Finally, we can spec special formatting for the cells in the 4 corners. This sequence moves from the general to the particular and also from the most common to the rarest formatting.

This sequence is how the table style dialogs in Word for Windows and Excel present table elements. It’s similar to the order in which we enter the information in an XML custom table style. If you follow this order, you’ll get a custom style in much less time than if, for instance, you try to start with the even and odd rows.

Word’s custom table styles are stored in the styles.xml file. This is in the word folder of an unzipped file. The comparable file for PowerPoint is called tableStyles.xml in the ppt folder. The XML is similar in concept, but the differences mean you can’t copy and paste from one program to another. If you’re not sure where to find these files, please read XML Hacking:An Introduction. If you’re editing on a Mac, you should also read XML Hacking: Editing in OS X

Below is a typical PowerPoint table style. I’ve broken the listing into 4 pieces so it fits on the page. Copy and paste them together into one listing, or download it as a zipped text file:


Table Style Starter File

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:tblStyleLst xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" def="{0817EA92-75D0-4044-A80A-286907CE0DDB}"/>
<a:tblStyle styleId="{0817EA92-75D0-4044-A80A-286907CE0DDB}" styleName="Custom Table Style" >
  <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:left >
          <a:ln w="0" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="bg1"/ >
            </a:solidFill >
          </a:ln >
        </a:left >
        <a:right >
          <a:ln w="0" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="bg1"/ >
            </a:solidFill >
          </a:ln >
        </a:right >
        <a:top >
          <a:ln w="0" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="bg1"/ >
            </a:solidFill >
          </a:ln >
        </a:top >
        <a:bottom >
          <a:ln w="0" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="bg1"/ >
            </a:solidFill >
          </a:ln >
        </a:bottom >
        <a:insideH >
          <a:ln w="114300" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="bg1"/ >
            </a:solidFill >
          </a:ln >
        </a:insideH >
        <a:insideV >
          <a:ln w="114300" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="bg1"/ >
            </a:solidFill >
          </a:ln >
        </a:insideV >
      </a:tcBdr >
      <a:fill >
        <a:solidFill >
          <a:srgbClr val="F5F9FD"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:wholeTbl >
  <a:band1H >
    <a:tcStyle >
      <a:tcBdr/ >
      <a:fill >
        <a:solidFill >
          <a:schemeClr val="accent6"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:band1H >
  <a:band2H >
    <a:tcStyle >
      <a:tcBdr/ >
    </a:tcStyle >
  </a:band2H >
  <a:band1V >
    <a:tcStyle >
      <a:tcBdr/ >
      <a:fill >
        <a:solidFill >
          <a:srgbClr val="F5F9FD"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:band1V >
  <a:band2V >
    <a:tcStyle >
      <a:tcBdr/ >
    </a:tcStyle >
  </a:band2V >
  <a:lastCol >
    <a:tcTxStyle >
      <a:fontRef idx="minor" >
        <a:prstClr val="black"/ >
      </a:fontRef >
      <a:schemeClr val="lt1"/ >
    </a:tcTxStyle >
    <a:tcStyle >
      <a:tcBdr/ >
      <a:fill >
        <a:solidFill >
          <a:srgbClr val="999999"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:lastCol >
  <a:firstCol >
    <a:tcTxStyle >
      <a:fontRef idx="minor" >
        <a:prstClr val="black"/ >
      </a:fontRef >
      <a:schemeClr val="dk2"/ >
    </a:tcTxStyle >
    <a:tcStyle >
      <a:tcBdr/ >
      <a:fill >
        <a:solidFill >
          <a:srgbClr val="F3F3F4"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:firstCol >
  <a:lastRow >
    <a:tcTxStyle >
      <a:fontRef idx="minor" >
        <a:prstClr val="black"/ >
      </a:fontRef >
      <a:schemeClr val="dk1"/ >
    </a:tcTxStyle >
    <a:tcStyle >
      <a:tcBdr >
        <a:top >
          <a:ln w="114300" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="lt1"/ >
            </a:solidFill >
          </a:ln >
        </a:top >
      </a:tcBdr >
      <a:fill >
        <a:solidFill >
          <a:srgbClr val="CCCCCC"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:lastRow >
  <a:firstRow >
    <a:tcTxStyle >
      <a:fontRef idx="minor" >
        <a:prstClr val="black"/ >
      </a:fontRef >
      <a:schemeClr val="lt1"/ >
    </a:tcTxStyle >
    <a:tcStyle >
      <a:tcBdr >
        <a:bottom >
          <a:ln w="114300" cmpd="sng" >
            <a:solidFill >
              <a:schemeClr val="lt1"/ >
            </a:solidFill >
          </a:ln >
        </a:bottom >
      </a:tcBdr >
      <a:fill >
        <a:solidFill >
          <a:schemeClr val="dk2"/ >
        </a:solidFill >
      </a:fill >
    </a:tcStyle >
  </a:firstRow >
</a:tblStyle >

Breaking Down Custom Table Styles

That's a big pile of XML to throw at you. Let's break it down, first, the section that sets parameters for the whole table. Think of this like a layer cake, with the WholeTbl section being the first layer. Then later attributes are superimposed on top of it.

01 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
02 <a:tblStyleLst xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" def="{0817EA92-75D0-4044-A80A-286907CE0DDB}"/>
03 <a:tblStyle styleId="{0817EA92-75D0-4044-A80A-286907CE0DDB}" styleName="Custom Table Style" >
04   <a:wholeTbl >
05     <a:tcTxStyle >
06       <a:fontRef idx="minor" >
07         <a:prstClr val="black"/ >
08       </a:fontRef >
09       <a:schemeClr val="dk1"/ >
10     </a:tcTxStyle >

Line 2 is the container tag that holds individual table styles. The last part of the tag includes the def tag that sets which table style will be used as the default. Paste in the GUID of your custom style here to make it the automatic style in a template or presentation.

From line 3 to 8, we set the font characteristics that we can: idx="minor" means the font will be the theme body font. The actual font used is set in the theme, not here. Line 5 sets a dummy font color, in this case the Office preset color Black. Then in line 8, the actual color is set to the dark1 theme color.

11     <a:tcStyle >
12       <a:tcBdr >
13         <a:left >
14           <a:ln w="0" cmpd="sng" >
15             <a:solidFill >
16               <a:schemeClr val="bg1"/ >
17             </a:solidFill >
18           </a:ln >
19         </a:left >

Line 10 begins formatting the default borders. Beginning at line 12, the left border is set to w=0, meaning it has a 0 thickness and does not display. If it did display, the color setting in line 14 would set it to bg1, or the first background color, normally white in most themes. The following sections for right, top and bottom borders are identical.

41         <a:insideH >
42           <a:ln w="114300" cmpd="sng" >
43             <a:solidFill >
44               <a:schemeClr val="bg1"/ >
45             </a:solidFill >
46           </a:ln >
47         </a:insideH >

By contrast, look at line 40 for Inside Horizontal borders (the ones between each cell. Here the weight is set w=114300. The measurement units are EMUs or English Metric Unit, a made-up measurement system that allows easy conversion between English and Metric systems. At 914400 EMUs per inch, it means the line weight is 1/8 of an inch, unusually thick borders for a table.

56       <a:fill >
57         <a:solidFill >
58           <a:srgbClr val="F5F9FD"/ >
59         </a:solidFill >
60       </a:fill >
61     </a:tcStyle >
62   </a:wholeTbl >

Then, starting on line 55, are the fill settings for default cells. Line 57 set them to an RGB color value, since this is a tint not found in the theme. The color notation is hexadecimal, just as on an HTML page.


Custom Table Style Layers

Next up is the section for the odd and even-numbered horizontal bands:

63   <a:band1H >
64     <a:tcStyle >
65       <a:tcBdr/ >
66       <a:fill >
67         <a:solidFill >
68           <a:schemeClr val="accent6"/ >
69         </a:solidFill >
70       </a:fill >
71     </a:tcStyle >
72   </a:band1H >
73   <a:band2H >
74     <a:tcStyle >
75       <a:tcBdr/ >
76     </a:tcStyle >
77   </a:band2H >

In XML, an empty or unused attribute closes itself, as does the final object in a chain of references. Line 64 shows <a:tcBdr/ > with a slash right after the name. The slash closes the border attribute, indicating that adding odd-number row formatting doesn't include a change to the borders. On the other hand, the fill is active, using the Accent 6 color from the theme. Accent 6 closes itself because it's the final item of information in defining the fill.

Compare lines 72 to 76 (even-numbered rows) with 63 to 71 (odd-numbered rows). No format was set for even-numbered horizontal rows, so applying this attribute in Office will have no effect on the table appearance.

Next up are banded columns. This is similar to the banded row section: odd-numbered rows are defined, but not even-numbered. The fill color is a hexadecimal RGB, value, since this color is not in the theme:

78   <a:band1V >
79     <a:tcStyle >
80       <a:tcBdr/ >
81       <a:fill >
82         <a:solidFill >
83           <a:srgbClr val="F5F9FD"/ >
84         </a:solidFill >
85       </a:fill >
86     </a:tcStyle >
87   </a:band1V >
98   <a:band2V >
99     <a:tcStyle >
100       <a:tcBdr/ >
101     </a:tcStyle >
102   </a:band2V >

After banded rows and columns, we proceed to first/last rows and columns, more layers in the cake. Here's the XML for the Last (rightmost) Column:

103   <a:lastCol >
104     <a:tcTxStyle >
105       <a:fontRef idx="minor" >
106         <a:prstClr val="black"/ >
107       </a:fontRef >
108       <a:schemeClr val="lt1"/ >
109     </a:tcTxStyle >
110     <a:tcStyle >
111       <a:tcBdr/ >
112       <a:fill >
113         <a:solidFill >
114           <a:srgbClr val="999999"/ >
115         </a:solidFill >
116       </a:fill >
117     </a:tcStyle >
118   </a:lastCol >

This contains sections for font, border and fill parameters. As with the whole table section, font formatting is limited to speccing which theme font and color to use. No borders are assigned and the fill color is an RGB gray. Here are the remaining parameters for the First (leftmost) Column, the the last (bottom) row and first (top) row. In the Office interface, the top-most row is referred to as the Header Row and the bottom-most as the Total Row.


Custom Table Styles - Color Models

Here are the different ways you can spec color. Use the same syntax for fonts, borders and fills:

<a:schemeClr>: These access the Theme Colors. For the 2 pairs of light and dark colors that form the first 4 in a theme, you may see them variously as lt1, dk1, lt2 and dk2, or bg1, tx1, bg2 and tx2. Be careful with using the last 4, because Office Open XML allows mapping other colors to bg and tx. The safer choices are lt and dk. These are followed by the 6 accent colors: accent1 through accent6. Finally hlink and folHlink designate the hyperlink and followed hyperlink colors.
Examples are <a:schemeClr val="lt1"/> or <a:schemeClr val="accent2"/>.

<a:srgbClr>: Sometimes you need colors that are not in the theme. This color model uses hexadecimal colors, exactly the same as used in HTML.
<a:srgbClr val="F5F9FD"/> is one example.

<a:scrgbClr>: This is also RGB, but uses percentages instead of hexadecimal:
<a:scrgbClr r="50%" g="50%" b="50%"/>.

<a:hslClr>: If you need to use HSL (Hue, Saturation and Luminance), this is the model for you.
Try <a:hslClr hue="14400000" sat="100%" lum="50%"/>.

<a:prstClr>: These are a limited range of named colors that were used in early versions of Microsoft Office. They're just here for legacy file format support, but you'll see them used in some XML sample listings.
An example would be <a:prstClr val="black"/>.

<a:sysClr>: This model allows you to use operating system colors. Beware, you'll get different results in OS X then in Windows, and users can customize their system colors as well.
<a:sysClr val="windowText"/>.

Clearly, when you edit this XML by hand, you'll need to be familiar with the custom color theme used in the file and its hex values. Read my post on this subject: XML Hacking: Color Themes Next time we'll take a look at how table styles connect with the Office program interface to give the user access to these features

As always, if this seems too daunting, Brandwares is here to create custom table styles for you. Contact me at production@brandwares.com.

2:17 am

140 thoughts on “OOXML Hacking: Custom Table Styles

  1. Thank you for the helpful article. Is it possible to create a table style in Word and then apply the XML file in PowerPoint?

    • Unfortunately, the XML syntax for table styles is quite different. As one example, PowerPoint uses an a: prefix while Word uses w: at the start of every line. In addition, Word stores the table styles with all the text styles in styles.xml. PowerPoint doesn’t have text styles, so its table style file is called tableStyles.xml

    • I have been taught that when you area creating custom document “Themes” for corporate use that are going to be shared between the 3 applications, Word Excel and PowerPoint, you MUST start the creation process in PowerPoint. Apparently PPT has a unique few theme elements. If they are not included in the theme XML file at create they will NOT be added later.

      I don’t know if this applies to trying to share XML Table formatting.

      • It’s not absolutely necessary to create a Theme in PowerPoint. But if you save one in Word or Excel, the Theme will contain only the Color, Font and Effect themes, so the information is quite basic. If you save a theme from PowerPoint, it will save all the presentation custom formatting, so you can create a complete PowerPoint presentation from it.

        Unfortunately, Excel and Word use different XML for tables, so the PowerPoint custom table style is not usable in the other programs.

  2. Hi John,
    You say “Here’s a typical table style” but don’t say how to get this XML file. I’m assuming that these reside somewhere in the Office installation or can be extracted from files therein? Could you elaborate?
    Thanks, Chris

  3. Is it possible to program different second (subheading row) in the styles.xml file, and is it true that if a table is styled in Word and copy pasted in PowerPoint XML with syntax fixes it will do the job?

    • A subheading row would be a useful addition to Microsoft’s table model, but there’s nothing in the current version to format one.

      While the basic structures of tables are similar in Word and PowerPoint, it looks like the XML was developed by separate teams. There are so many small differences, and Office is so intolerant of even slightly malformed XML, I can’t see any way it would save any time to modify and paste the tables.

  4. I’m trying to edit the table styles in a .potx right now. Does this only work in .ppt or .pptx? When I make the changes in the XML for my .potx and then go reopen the file, nothing seems to have changed.

    • This technique wouldn’t work for a PPT file, which is the old binary format for Office 2003 and earlier. But it does work for POTX and PPTX.

      When you first add a custom table style, the presentation itself doesn’t change. But when you click on the Table Style Gallery, you’ll see a new row labelled Custom at the top. That row will contain your new table style. Select a table, then apply the style to it. Now if you save the template file to a new folder, expand the XML and edit the table style, the table style changes will be visible in your sample table after you re-zip the file and look at it in PowerPoint.

  5. Thank you for the thorough information in this set of tutorials. I wanted to try creating a customized table in Powerpoint, but first tried just using the code you provided above. I am having an issue getting the code to work in the “tableStyles.xml” file. When I try to open the resulting .pptx file after changing the file, Powerpoint says there is an error and cannot repair the file. In the end I cannot see the custom table available in the ribbon. I also noticed when I copied the text over in Notepad++ I received an error: “XML Parsing error at line 167: Couldn’t find end of Start Tag schemeClr line 166” I wonder if this is the problem, but am not sure how to fix it. I tried this is multiple .pptx files, including a brand new blank set of slides. Thanks for any advice.

    • This is one of the pitfalls of hacking Open Office XML. Office has no debugging facility for this. Even a tiny spelling or syntax error will cause PowerPoint to throw out the custom coding without telling you what the problem was.

      The NotePad++ error sounds like it might be pointing in a useful direction. Opening XML files in Firefox can also be useful for tracking down mistakes. All XML statements have both an opening and closing. If the statement contains other XML statements, the opening will look like this:

      <a:solidFill>  Opening tag for fill statement
        <Another XML statement>
      </a:solidFill>Closing tag for fill statement

      If the XML statement has only one line, it must end with />. The slash acts as a closing tag for the statement, like this:

        <a:schemeClr val=”bg1″/>

      When you’re getting started, you may find it easier to work this way:

      1. Insert a table in your template or presentation and give it one of the stock styles.
      2. Expand the XML and find the table style in ppt/tableStyles.xml.
      3. Rename the style and give it a different GUID.
      4. Zip the XML and test it in PowerPoint.
      5. Unzip the working presentation to a new set of XML files.
      6. Make one change at a time and between each, zip the files and test them. Stop when you get an error and return to the last version that worked and try again.

      While this process is tedious, it’s much faster than making multiple changes, then searching for tiny errors in a non-functional file.

  6. All of this was a very helpful, thank you. Now that I have gotten started, I am trying to dive into something more advanced. Specifically, trying to add borders that are dashed rather than solid. I have tried to find some of the syntax I need, but I am having a lot of trouble. Do you know where there is a list of the syntax I need, or can you provide that syntax?

    • Borders for table styles use the a:ln element. You can find the parameters for this by Googling a:ln ooxml. Both solid and dashed borders use a:ln, but dashed borders add some parameters. The Datypic.com site has a basic listing of line settings. The Office Open XML site has a more verbose description of borders.

      A solid line spec will look like this:

      <a:insideV>
        <a:ln w="12700" cmpd="sng">
          <a:solidFill>
            <a:schemeClr val="lt1"/>
          </a:solidFill>
        </a:ln>
      </a:insideV>

      A dashed border is similar, but with more parameters. The new ones are bolded:

      <a:insideV>
        <a:ln w="12700" cmpd="sng" cap="flat" algn="ctr">
          <a:solidFill>
            <a:schemeClr val="lt1"/>
          </a:solidFill>
          <a:prstDash val="sysDash"/>
          <a:round/>
          <a:headEnd type="none" w="med" len="med"/>
          <a:tailEnd type="none" w="med" len="med"/>
        </a:ln>
      </a:insideV>

      The purpose of these is as follows:

      cap=”flat” – sets the shape of the dash ends.

      algn=”ctr” – sets lateral position of the line relative to its center.

      a:prstDash val=”sysDash” – sets the dash style. These are the same as the selection of dashed line styles you see in a border dropdown.

      a:round – sets the corner join shape where 2 lines meet.

      a:headEnd type=”none” w=”med” len=”med” and a:tailEnd type=”none” w=”med” len=”med” – sets the shape of the end of the line. You would use this to add an arrowhead or other shape, not relevant in the context of a table.

      This is a very basic overview to get you started. Eventually I’ll write this up into a full article.

  7. With the following table style only firstRow is showing up, firstCol is not. What could be wrong?

    <a:firstCol>
    <a:tcTxStyle >
    <a:fontRef idx="minor" >
    <a:prstClr val="black" />
    </a:fontRef >
    <a:schemeClr val="bg1" />
    </a:tcTxStyle >
    <a:tcStyle >
    <a:tcBdr />
    <a:fill >
    <a:solidFill >
    <a:schemeClr val="accent1" />
    </a:solidFill >
    </a:fill >
    </a:tcStyle >
    </a:firstCol>
    <a:firstRow>
    <a:tcTxStyle >
    <a:fontRef idx="minor" >
    <a:prstClr val="black" />
    </a:fontRef >
    <a:schemeClr val="bg1" />
    </a:tcTxStyle >
    <a:tcStyle>
    <a:tcBdr />
    <a:fill >
    <a:solidFill >
    <a:schemeClr val="accent1" />
    </a:solidFill >
    </a:fill >
    </a:tcStyle>
    </a:firstRow>

    • Since this is only part of the table style, it’s hard to tell what the problem might be. Feel free to send me the PowerPoint file with the table style. My address is production at brandwares dot com.

  8. Compliment for this great tutorial, Mr. Korchok. It helps me a lot. Now, I’m looking for the TableRowHeight Class in OOXML. Where can I define it into the the table style parameters? Thank you for your help.

    • Table Styles don’t include all table parameters. Row heights, column widths and cell margins are among these. You’ll have to include a sample with an explanation, so users can re-create the right look, or you’ll have to write a macro to post-process the table and set your preferred dimensions.

      • Thank you for your answer. Well, it works now by VBA makro, but I’m not very happy with it. Isn’t it strange that Microsoft does not provide a solution for it in Open XML? }:-7

  9. I am just editing the tablestyles.xml and slidemaster.xml for a new Powerpont-Presentation and I want to change the default linespacing from “Single” to “Multiple at 1.3”. Is this adjustment possible or not part of the table style parameters? Thank you for your help.

    • You can set linespacing in slidemaster1.xml in the otherStyle section. Here’s a sample of xml that shows settings for linespacing set to Multiple at 1.3, space before, space after and default tabs:

      <a:lvl2pPr marL="0" indent="0">
        <a:lnSpc>
          <a:spcPct val="130000"/>
        </a:lnSpc>
        <a:spcBef>
          <a:spcPts val="1200"/>
        </a:spcBef>
        <a:spcAft>
          <a:spcPts val="500"/>
        </a:spcAft>
        <a:tabLst>
          <a:tab pos="457200" algn="l"/>
          <a:tab pos="914400" algn="l"/>
          <a:tab pos="1371600" algn="l"/>
        </a:tabLst>

      For complete coverage of all parameters you can set in the otherStyle section, please read my articles about setting Textbox Styles: XML Hacking: Text Box Styles and XML Hacking: Styled Text Boxes Complete. The syntax is exactly the same.

  10. thank you so much for this great resource. I am now trying to modify a style in Word after having used this page extensively for PPT. Do you have a Word table example page or no because Word has some (limited) built in ability to create custom tables?

    • Word and Excel can create fairly complete custom table styles with the tools in the interface, but the process is far from intuitive. Thanks for writing, you’ve given me the subject for my next post!

      • i’ll be sure to look for it. also, do you have anywhere where you review how bullets/numbered lists work in Word? I find that after I make a multi level style, I cannot edit its sub layers once I have hit “Ok” on the style. after that, all i can do is edit the top most level. furthermore, it then creates a paragraph style which is not the same name as the name i assign it. I don’t understand Word’s internal logic for how the two are connected and why the naming difference. I am sepculating that if I even need to re-edit the bullet list, I have to go into the XML but i am completely lost when looking for it.

        • I agree, the logic behind numbered or bulleted styles is hard to understand. Shauna Kelly’s article shows a reliable technique How to create numbered headings or outline numbering for Windows. For a Mac translation, please see my article Outline Numbering in Word for OS X. These articles assume you are applying numbering to the built-in heading styles, but you can apply numbering to any set of styles by using the instructions in Outline Numbering Variations.

          You can create nested sets of bullet styles by following the same steps. When the Define new Multilevel list dialog is open, use the dropdown called Number style for this level, scroll all the way down and you’ll find 6 bullet presets and options for choosing a different bullet or a picture bullet. I’ll add this information to the article about Outline Numbering Variations.

  11. Thank you so incredibly much for creating this. You rock!

    I followed your instructions and was able to create a new Custom Style in ppt with the last row in bold. However, the bold only shows up when I have Total Row checked.







    Is there anyway to get the bold to always appear? Or even set the Total Row button to be automatically checked?

    I am also looking to modify the text alignment depending on the column (i.e. first column would be left aligned, all others would be right aligned). From your Default Table Text article, it doesn’t seem like this is possible. Could you confirm?

    Appreciate your guidance! And again, thank you for guiding us!

    • To get your XML code to appear in your post, please follow the instructions just above the Comment box for substituting the < and > signs.

      PowerPoint’s default settings check only the Header Row and Banding options. I don’t see way to set different defaults (they appear to be hard-coded in the program), and they is no place to set the Table Style Options in the table style XML. I’m afraid you’ll have to continue checking the Table Style Option after every table insertion.

      Below is the XML that includes the table style options with Total Row turned on. This appears in the slide XML only after inserting a table.

      <a:graphic>
        <a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table">
          <a:tbl>
            <a:tblPr firstRow="1" lastRow="1">
              <a:tableStyleId>{0817EA92-75D0-4044-A80A-286907CE0DDB}</a:tableStyleId>
            </a:tblPr>
  12. Hi,
    The article is great!!! I was wondering if it is possible to set the custom table style as the default in Powerpoint. So every time the user creates a new table then this table will get the custom table design i created automatically

    • In Windows versions of PowerPoint, create a table so that the Table Styles gallery opens. Click on the gallery opener on the right side, then right-click on your custom style and choose Set as Default. Then every new table that is inserted will be in the custom style.

      Mac versions don’t have the same feature in the program interface. Instead, when you are editing the XML of tableStyles.xml, edit the second line, changing the def parameter to be the GUID of your custom table style. So if the GUID of your custom style is {0817EA92-75D0-4044-A80A-286907CE0DDB}, edit the second line to read <a:tblStyleLst xmlns:a=”http://schemas.openxmlformats.org/drawingml/2006/main” def=”{0817EA92-75D0-4044-A80A-286907CE0DDB}”>. This sets the default.

  13. Hi,
    I am trying to use so other content of a:tblStyle, such as seCell,neCell etc. I added it at the end of the schema but didn’t work. Is it possible to use these here? The purpose is to create a special colored cell top left and bottom right if user has a total last row

    • It seems to work only for the nwcell (topleft) when first column is clicked in Table Style Options.
      I used the code below and copy-paste it to create the different nodes
      <a:nwCell>
      <a:tcTxStyle>
      <a:fontRef idx=”minor”>
      <a:prstClr val=”black”/>
      </a:fontRef>
      <a:srgbClr val=”FF”/>
      </a:tcTxStyle>
      <a:tcStyle>
      <a:fill>
      <a:solidFill>
      <a:schemeClr val=”accent3″/>
      </a:solidFill>
      </a:fill>
      </a:tcStyle>
      </a:nwCell>

      • Sorry for my delayed response, I had to do a little research. Corner cell styling only get turned on if both the row and column options that intersect it are turned on. So if Header Row and First Column are checked, the upper left (NW) corner styling will appear. Total Row and First Column turns on the lower left (SE) corner, etc. There is no way to turn on the corner styling unless the intersecting row and column options are both checked by the user. I’ve never run across a method of presetting those options in a table style.

  14. I’ve just started doing XML hacking by following your posts here. They are so helpful. Thank you.

    My problem is that even though I’ve set all the borders to w=”0″ they are still appearing in the table. I can even change the a:solidFill to a different color and that color will appear so I know it’s reading that code but I just can’t get the borders to turn off completely. Can you help?

    • As you’ve discovered, setting the line width to 0 still displays a hairline. If you give the lines an a:noFill parameter, they will not show:

      <a:ln w=”0″ cmpd=”sng”>
        <a:noFill/>
      </a:ln>

      • What about Smart Art? Is there a way to hack the Smart Art gallery or formatting settings so you can change things like font color and border color?

          • Sorry to pester.

            Which xml file would hold the code for the Smart Art? I’d like to get in there and play around as soon as possible since I’m on a bit of a deadline.

      • I I left a comment a few days ago but it doesn’t seem to have gone through.

        My question is whether it’s possible to alter Smart Art settings (like text color, border color etc.) using XML hacking.

        • Oops. As soon as it published my most recent comment it showed me your reply! Sorry about that. 🙂 I would be very interested in that series of articles!

          • I don’t know where that file might have been. The book was written 11 years ago, before Office 2007 was actually released, so that file may never have been included in the final version.
            You can download a variety of sample .glox files from Loki3 Diagrams. That should get you started.

        • To alter an existing SmartArt diagram, unzip the file containing it, then look in word/diagrams (if it was created in Word) or ppt/diagrams for a PowerPoint diagram. There will be 5 XML files for each diagram. Here’s a page from Microsoft that describes the function of each: SmartArt File Structure
          Creating a SmartArt template for distribution is a completely different and more complex operation that really needs full articles to explain it. In the meantime, here is the best reference available: Leveraging SmartArt Graphics

          • Thank you for that reference! I have purchased it and am following the steps. Only one thing, he mentions there being a Sample.glox somewhere on the machine but I can’t find it. I’m assuming that was an older version of Windows? The link in this book to the page on his website with further information no longer works. Do you know where I could get a hold of a Sample.glox? I’ve done a bit of searching online but so far haven’t turned up the file.

  15. Hi,

    I would like to know where is the folder location for the custom table style files.

    What is the exentions of theses files.

    Thanks
    Youness

    • Word’s custom table styles are stored in the styles.xml file. This is in the word folder of an unzipped file. The comparable file for PowerPoint is called tableStyles.xml in the ppt folder.

  16. Hi,
    Thanks for a great guide, this is really useful!
    I have one question though:
    Can you apply the add table to a .thmx file? I’d like the custom table styles to be there when I create a new file (using custom theme as default). Is this possible?

    Thanks,
    Simon

    • Unfortunately, custom table styles do not travel with a theme (*.thmx) file. Instead, save the file as a template (*.potx or *.potm) and create new presentations from that. You can set a template to be the default just as easily as setting a default theme. For reference, here is an article by Stephen Rindsberg with the steps for each version of PowerPoint.

      • You are an absolute star.
        The bit I’d missed is that if you have previously set a default theme you have to delete ‘default theme.thmx’, otherwise Blank.potx is ignored by PowerPoint.
        Deleting it allowed my potx to appear as the default and now my tables are as I would like them 🙂
        Thanks!
        Also, I have to say I’m impressed how promptly you answer comments on what is a relatively old page. Much appreciated!

  17. Hi. I always thanks to your kind information. It’s really useful.
    I am trying to adapt the xml into my custom file, but it doesn’t work.

    Below are the steps i did.

    1. Copy your xml
    2. Unzip Find ppt/tableStyles.xml and open it.
    3. Remove the original coding like below
    (
    )
    And paste your xml. Then, exchange the GUID to a new one.
    4. Rezip to pptx. (Just wanted to confirm that the custom table style was well-made)
    5. Open the pptx -> in this step i have an error! PowerPoints says that it’ll try to repair.

    If i did a wrong step, please let me know.

    Sorry for my short tongue. RSVP

    • Oh I noticed I pasted wrong. Below may be the correct one.

      Below is the original xml code I can see.

      <?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”? %gt;
      <a:tblStyleLst xmlns:a=”http://schemas.openxmlformats.org/drawingml/2006/main” def=”{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}”/ %gt;

    • PowerPoint is not very helpful in their error messages, but it sounds like you accidentally entered some malformed XML. When PowerPoint offers to repair the presentation, it’s because there is a relatively small error. This could be something a simple as smart quotes replacing straight quote, easy to get if you editing in TextEdit on the macOS.

      Feel free to email the XML or the whole presentation to me at production at brandwares dot com, and I’ll take a look. If you do this, please include what operating system and version of Office you are using.

  18. Hi,

    thank you for all the tutorials, they are extremely helpful!

    I have two questions:

    1. Is there a way to remove or hide the automatically created design propositions for tables from the design tab? I found the checkbox for displaying only the custom ones, and suppose there has to be a place in xml to set it as a default option.

    2. I have created a couple of custom table styles in tableStyles.xml but failed to add outer shadow. My investigation led me to theme.xml files and effectStyleLst paragraph, but still I can’t figure out how to use the defined outer shadow in tableStyles.xml.

    I’d really appreciate your help!
    Thanks,
    Wiolistka

    • Thanks for your kind words.

      The Microsoft table styles appear to be generated automatically by the program. I don’t know of any way to remove them.

      After you create a custom table style, you can open the template in PowerPoint, insert a table, right-click on the new style and choose Set as Default. Then all tables will automatically have your styling when inserted. Then just tell your users not to apply any of the other styles.

      You are correct that shadows are part of an effects theme, not a table style. Effects themes are a fairly complex subject that would take numerous blog posts to explain. Instead I’m writing a book about XML that will cover all the details. I’ll be announcing its publication here when it’s ready.

  19. Hi,

    I’m updating a PPT we made a few years back with the help of your guide and want to remove some previous options. However, whenever I attempt to remove a style by deleting all its content (from the tblStyle tag to its corresponding close tag), I get an error upon copying it back into the PPT zip file. The zip file becomes unusable and must be deleted.

    What am I doing wrong in trying to remove one of the table styles?

    • I understand it’s tempting to delete table styles you think are unused. However, most often PowerPoint knows when it needs to retain old formatting information. I never delete any old tableStyles, because they represent styles that have been applied, sometimes to objects you don’t immediately recognize as a table. If any table uses a particular style and that style is deleted, it will generate an error.

      I recommend retaining all old table styles. Just add your new style. The savings in file size is insignificant.

  20. Any ideas on which XML fragment needs to be edited to set the vertical alignment of text within cells?
    I understand that size, etc is set within the lvl1pPR element and there is horizontal alignment set in that element but where do we set the vertical alignment of the text within those table cells? For instance a header row may be anchored at the bottom of a cell, but the main non-header content row text may be centered vertically within the content cells.

    • Sorry, but it’s not possible to set vertical alignment in a table style. The XML vertical alignment parameters are for vertical alignment relative to the text baseline, not to the table cell.

      You also can’t set cell margins or row heights or column widths, and spacing before and after paragraphs is ignored inside a table. Your ability to preset the final look of a table is limited.

  21. I am working in Windows 10 and need to set a default table font in a PowerPoint template, and I very much appreciate your instructions! I have downloaded Notepad++ and added .zip to my PPT filename, then opened the folder. I see your instructions on selecting 4 of the folders inside the zipped folder and creating a zipped file from them. I’m not sure how to perform this step. Do I need to extract these to a new folder location and then zip that folder by adding .zip to the folder name? Then once I work through the table style editing, change the folder extension to .pptx?

  22. If the whole table style sets a border, say the top border, can the First Row definition override this and turn it off? The following doesn’t work for me:

    <a:top>
    <a:ln w=”0″ cmpd=”sng”>
    <a:noFill/>
    </a:ln>
    </a:top>

    • You snippet shows the correct syntax for overriding the parameters of the whole table. Here’s a more complete first row definition:

      <a:firstRow>
        <a:tcTxStyle>
          <a:fontRef idx="minor">
            <a:prstClr val="black"/>
          </a:fontRef>
          <a:schemeClr val="lt1"/>
        </a:tcTxStyle>
        <a:tcStyle>
          <a:tcBdr>
            <a:top>
              <a:ln w="0" cmpd="sng">
                <a:noFill/>
              </a:ln>
            </a:top>
          </a:tcBdr>
          <a:fill>
            <a:solidFill>
              <a:schemeClr val="dk2"/>
            </a:solidFill>
          </a:fill>
        </a:tcStyle>
      </a:firstRow>

      If you can’t get it figured out, feel free to email the complete table style definition to me and I’ll take a look at it. production at brandwares dot com

  23. Awesome!

    Is there a way to show the vertical lines in front of the horizontal lines? To be exact: I want white vertical lines in front of black horizontal lines, so that you only see the interruption in the black horizontal lines. The background is also white.

    BR
    Donald

    • Good question, thanks. Normally in Office XML files, the order of XML elements is also the reverse stacking order of elements on the slide. So if the slide XML contains a Title placeholder, then a Content placeholder, on the slide the Content placeholder will be in front of the Title.

      In table styles, this doesn’t hold true. We might expect that moving the <a:insideH> below the <a:insideV> section would put the horizontal lines above the vertical lines. But in table styles, there is a fixed order that PowerPoint expects. Not only do the horizontal lines not pop to the front, but when you save the file, the <a:insideH> section is deleted from the table style because it is out of order!

  24. Hi John –

    Thank you for another great post! This is something that I could definitely use on a project but I am having trouble finding the tablestyles.xml on my computer. I ran a search on the entire hard drive for this file and came up empty. Can you please provide the exact path this file would be under?

    I am on Mac OSX 10.12.6 and running PowerPoint 16.21.

    Also, if there is a custom table style that another PPT file came in with, is it possible to access that XML and build on top of it?

    Thank you in advance,
    Niyati

  25. Hi John –

    Thank you for this very helpful post! I had a question about color specifications. Is it necessary to specify a scheme color tag when defining a font style for the first row? Or is it enough to just specify the Hex value? I would like to keep only the Hex value in the event that the end user changes the order of the theme color. I don’t want my table style to be impacted by this. Here is the code that I am using:

    “<“a:tcTxStyle b=”on””>”
    “<“a:fontRef idx=”minor””>”
    “<“a:srgbClr val=”00CD82″/”>”
    “<“/a:fontRef”>”
    “<“a:schemeClr val=”dk2″/”>”
    “<“/a:tcTxStyle”>”

    Thank you in advance!
    Niyati

  26. Please ignore the “”marks around the “<“, “>” – I did a copy paste and didn’t realize that the “” were not part of the character replacement.

    Thanks!

  27. John, these are great articles. Thank you for sharing your knowledge – it’s really opened my eyes to what can be achieved.

    I have created a custom table style successfully but would like to create a second one in the same template to appear alongside the first one in the Custom table styles gallery. I’m assuming the styleId value for each custom style has to be unique, so where does that value come from for the second and subsequent table styles? For example:

    styleId=”{59DA6C20-CC5B-45AE-9D43-645F2BD884D3}” styleName=”Blue table”
    styleId=”{?????}” styleName=”Red table”

    Many thanks
    Richard

    • The Style ID is a GUID number (for Global Unique Identifier). They’re random hexadecimal numbers. Search for GUID Generator to find web tools that will create these for you. It’s best to always create new GUID numbers for every table style.

  28. Hey John, I came across a weird behaviour of custom tables when exporting slides as images.
    We have defined 3 custom styles that fully work. When using a VBA function like <b&gtCurrentSlide.Export “path/image.jpg”, “JPG”, 3072<b&gt on a slide with one of our custom tables, the table on the exported picture loses all style information and gets replaced with the default standard table.
    I tried it with some of the stock PPT tables and they all retain their visual appearance.
    Have you experienced this behaviour before? Do you have any explanation?

    • When posting, if you add non-breaking space characters, your indentation will be maintained.

      Adding borders for left and right will just add borders to the outer left and right edges of the whole row. To affect inside borders, use insideH and insideV. Here is XML to remove borders between adjacent header row cells:

      <a:insideV>
        <a:ln w="0" cmpd="sng">
          <a:noFill />
        </a:ln>
      </a:insideV>
      
  29. TAKE TWO
    Hi John,

    Thanks you for the amazing tutorials. Is there a way to eliminate column borders in the header row? I tried doing this in the <a:firstRow> section (see below) by nesting <a: right> and <a:left> attributes, but Powerpoint seems to ignore them.

    <a:firstRow>
    <a:tcTxStyle b=”on”>
    <a:fontRef idx=”minor”>
    <a:prstClr val=”black”/>
    </a:fontRef>
    <a:schemeClr val=”lt1″/>
    </a:tcTxStyle>
    <a:tcStyle>
    <a:tcBdr>
    <a:left>
    <a:ln w=”12000″ cmpd=”sng”>
    <a:noFill>
    <a:schemeClr val=”lt1″/>
    </a:noFill>
    </a:ln>
    </a:left>
    <a:right>
    <a:ln w=”12000″ cmpd=”sng”>
    <a:noFill>
    <a:schemeClr val=”lt1″/>
    </a:noFill>
    </a:ln>
    </a:right>
    <a:bottom>
    <a:ln w=”24000″ cmpd=”sng”>
    <a:solidFill>
    <a:schemeClr val=”lt1″/>
    </a:solidFill>
    </a:ln>
    </a:bottom>
    </a:tcBdr>
    <a:fill>
    <a:solidFill>
    <a:schemeClr val=”dk1″/>
    </a:solidFill>
    </a:fill>
    </a:tcStyle>
    </a:firstRow>

  30. Just re posting with code in (hopefully)
    Thank you for your post it is very helpful.

    I’m trying to use the same colours on my table design as are available in the colour theme ie Accent 2, lighter 80%, Accent 2, lighter 60%.

    I have seen the tint setting but can’t work out the values and the colours don’t match
    <a:schemeClr val=”lt2″>
    <a:tint val=”20000″/>
    </a:schemeClr>

    I have also found a shade setting but again I can’t work out the values
    <a:schemeClr val=”accent2″>
    <a:shade val=”10000″/>
    </a:schemeClr>

    Any idea on what these values are. I have found that tint does not like 6 digit numbers but other I can’t work out the relation of these settings and the colours on the colour theme.

    • I think you might be referring to the table of tints and shades that appear below the top row of theme colors. If that’s the case, you can get those values by creating a file with several shapes, applying the tints and shades to those shapes, then opening the XML and seeing what values were applied. If that doesn’t answer your question, please clarify your goal.

      a:tint and a:shade do shift the hue. To make colors lighter or darker while preserving the hue, use luminance tags instead. <a:lumMod val=”50000″/> has no effect on the color, <a:lumMod val=”75000″/> makes it lighter and <a:lumMod val=”25000″/> makes it darker.

  31. Hello!
    Thanks for the tutorial.
    When I copying the table with custom style applied to another pptx file the style seems to dissapear. Is there way to preserve table style between different decks?

    • Table styles don’t travel with the pasted table. You can retain the appearance by choosing Paste Special and pasting as one of the picture formats. Or you can add the table style XML to the presentation receiving the paste.

      • Thanks for the answer!
        Any news on digital version of your book? Since I located in Russia it’s quite a quest to get a paper version 🙂

  32. Hi, Thanks for all your tutorial they have been really helpful.

    A quick question re the alignment of the text in a table.

    Am I correct in thinking you cannot set up a table to have the text in all the table cells set to centered but set to left aligned when the First column options is checked. I can’t see a way of setting the text alignment (ie left, right, centered) other than in the the Table Text using otherStyles which will affect the whole table.

    Am I correct in presuming the different table parts eg firstCol are only used for cell borders and shading and font formatting (eg colour and bold on or off).

    I could get around this by doing some manual post formatting after creating the table.

    Thanks for your help – Nikki

    • You’re right, table styles don’t capture text alignment in different table parts. They also don’t include vertical alignment or cell margins. The workaround is to set the first level of table text to be centered. This will be the default when the table is created. Set the second level to left aligned. Then after creating the table, select the first column and click on Home>Paragraph>Increase List Level (Windows) or Home>Indent More (macOS) to change the first column to the second text level

  33. Hello, John,

    i would like to automatically set firstCol and lastRow to true/on. (Just like with firstRow)

    For example, &lt a:tblPr firstCol=”1″ &gt

    Is that possible?

    Thanks for your help – Donald

  34. Hello John!

    Really nice posts! They have helped me a lot!

    I have a question about alignment though. In a previous comment you say: “. The workaround is to set the first level of table text to be centered. This will be the default when the table is created. Set the second level to left aligned.”

    Can this also be done for vertical alignment? I want to align the text in the table cells to the bottom. However, the ‘algn’ attribute doesn’t seem to have this option and I can’t find another element that would.

    Is it possible to do this?

    Many thanks for the help! – Karel

  35. Hello,
    thank you for your amazing guide.
    I was able to create my own table style, by adapting the tablestyles.xml file.

    One question)
    Is there an option to add more than one customer defined table style so that the end user will have the choice?
    I have tried to duplicate the content (line 2 to the end) and changed the Style name.
    I assume that the GUID has to be changed as well (but to which value)
    Any hints?

    Thanks
    Rainer

    • You can add many table styles, though only one can be set as the default. The GUID is a random number, the actual value doesn’t matter. You can generate them online, just do a search for GUID Generator.

      • I have not had the need to add more than two tables styles to a presentation template so far. But a client wanted a template for a bank (which means LOTS of tables in every presentation) and asked me whether there is an upper limit for the number of table styles you can add.
        Do you know of any limits? Would it be possible to add a dozen? Or 50?

        • I’ve done a test where I added many table styles (about 100) and didn’t have any problem technically. The Table Style Gallery gets to be huge with that many, so the user interface is awkward.

  36. Hi John,

    I am currently trying to add some custom styles I created in the past to a PPT template created by someone else. I expect to have to tweak settings after I get the new styles to show up in the destination file but that is where I am having problems. I have been creating and customizing table styles for a while now (thanks to your tutorials and book), but I am wondering if anything changed. after I insert my ported XML into the destination file’s tableStyles.xml, I get an error upon opening. PPT tells me it needs to be repaired, and then after repairing, the custom table styles do not show up. I must have re-read 10x the process of starting a table and generating a random GUID but PPT keeps deleting my custom styles.

    Any ideas what I could be doing wrong?

    This is my PPT Version if that makes any difference:
    Version 2008 (Build 13127.21668 Click-To-Run) Semi-Annual Enterprise Channel

    Thank you!

    • Table style operation hasn’t changed in Office. There is some small error in your tableStyle XML that PowerPoint can’t parse. Office programs have almost no debugging for XML issues, so it can be hard to find problems.>/p>

      The most common problem is including “smart” or curly quotes instead of straight quotes. Using a true text editor program can eliminate this problem.

      A mistake I make sometimes when revising an existing table style is to change the value of a parameter to an illegal type, because I forgot to change the parameter type. An example is if I start with <a:srgbClr val=”9AA4AF”/> and change the value to accent1 while forgetting to change a:srgbClr to a:schemeClr. This will cause PowerPoint to toss out the entire tableStyle: <a:srgbClr val=”accent1″/>.

      • OMG. I think I missed a few of those RGB to Theme color tag changes. I’ll try that now! and thank you!

  37. Hi there… I am a little lost as to how the GUID code is generated. If I am creating a custom table… where does that code come from?

  38. <a:tblStyleLst xmlns:a=”http://schemas.openxmlformats.org/drawingml/2006/main” def=”{ccbcac40-4277-425c-91d8-88d3c664c09f}”>

    • OK I see… read through more posts above I found one of the errors was not changing schemeClr to srgbClr and now I see one custom table in the list…

  39. Thank you John for this blog, it’s been my go to source of xml hackery for years and long may it continue.
    My question is with the font for the table style, as in:


    Is it possible to define a different font other than “major” and “minor”?
    I was able to read the font info from a user drawn table and my client would like to use the font in the table style.
    And out of curiosity, the idx parameter can also have the value of “none”. What is the effect of this?

    • You can use a non-theme font by replacing the a:fontRef section with an a:Font section and specifying the fonts:

      <a:tcTxStyle>
        <a:font>
          <a:latin typeface="Arial"/>
          <a:ea typeface="Arial"/>
          <a:cs typeface="Arial"/>
        <a:font>
        <a:schemeClr val="dk1"/>
      </a:tcTxStyle>

      Anyplace that you see a:fontRef idx=”minor”, you’ll have to replace that with another font definition, or delete it to allow the overall table font to take over.

  40. Sorry, missed the bit about the tags…
    Thank you John for this blog, it’s been my go to source of xml hackery for years and long may it continue.
    My question is with the font for the table style, as in:

    <a:fontRef idx=”minor”>
    <a:prstClr val=”black”/>
    </a:fontRef>

    Is it possible to define a different font other than “major” and “minor”?
    I was able to read the font info from a user drawn table and my client would like to use the font in the table style.
    And out of curiosity, the idx parameter can also have the value of “none”. What is the effect of this?

  41. Dear John:
    This page saved my bacon today. I’m no coder—it took me almost 9 hours, but I added several custom tables to the template I’d built with dual themes. Could not have done this without your resource.
    THANK YOU!
    Leslie

  42. Thanks for this guide it’s been extremely helpful. I was wondering if it is possible to have banded rows that just have a line between the rows. Basically, the table will have no lines when banded rows is selected the lines will be between the rows. I have tried a bunch of options but depending on the number of rows or if there is a header row It keeps messing up. I wind up with either a line at the the bottom of the table, the line goes every 2 rows or it just doesn’t appear. I appreciate any help.

    • I cover this in my ebook. The basic idea is to add the rules in the insideH section of the wholeTbl part of the style. Then in the band1H or band2H sections (whichever is getting the shading), turn the rules off and add the band shading. To turn the rules off, set both a:top and a:bottom to a line width of 0 with a noFill fill.

      Band1H will be the topmost row if the header row option is turned off. If the header row is turned on (the default when you insert a new table), then band1H is the second row. Band2H will be the second row if the header row is turned off and the third row if it is turned on.

      • Hey John,

        Thanks for the reply. I finally got back to working on this and this works, but it’s the reverse of what I was hoping for. It seems like I misspoke in my original comment. What I am looking for is the line between the rows to be visible when banded rows is checked and have them not visible when it is not checked (and I want the lines just in between and not on the top or bottom). Let me know if this is possible, if not I will have to live with telling everyone to uncheck the box to get the lines. Also, if I’m reading correctly, it’s not possible to have the banded row box unchecked by default? Also is your book available for Kindle? Thanks in advance.

        • Yes, it’s also possible to display rules only when bands are visible. (Just a note: The purpose of both rules and banding is to make rows easier to follow by eye, so using both is redundant.)

          The Header Row and Banded Rows options are both on by default when a table is inserted. You can’t change that behavior.

          My book is in epub format. Newer Kindles can read that format. Here’s a page that shows 3 ways to upload an epub file to your Kindle: How to Get EPUB Books on Kindle: The Ultimate Guide

  43. Hi John,

    Do you know how I can set the defaults of the table cells to centered and middle?
    So, if you insert a table, the text will be aligned centered and middle.

  44. Hi John,
    thank you for this extensive introduction! It has been so helpful and surely is the best OOXML guide out there.
    Allow me one question, please: is there a way to change custom position and dimensions for tables to be inserted? Which xml-file in the ppt would I need to change?
    Thank you for your advice!

    • Thanks for your kind words. The table size is determined by the placeholder into which you place it. So rather than editing XML, you would be using View>Slide Master and creating a custom layout with a Content or Table placeholder positioned where you want it to appear.

  45. Hi John,
    everything works perfectly when setting it up with your guide, I just need some guidance with banded rows/columns when both are selected in PPT.

    Independently, they work as expected however when I check both at the same time, the “columns” seem to override my rows and the banding in the rows no longer applies.

    • If you create a table, then apply one of the Microsoft styles that has banded rows and columns, that Microsoft style will be added to the tableStyles.xml part. Then you can compare your table style to the Microsoft style to see what’s different. Probably, those differences will be in the sections labelled a:band1H, a:band2H, a:band1V or a: band2V.

  46. Hi John,
    only you should know the answer if there is one )
    I’m trying to set a color for the first column and a gradient for the first row. But the first column color should have priority over the first row color, so that the cell (1:1) be colored as the first column, but not as the first row. As you describe those XML instructions as layers, I tried to change the order, so that firstCol was set after firstRow, but this doesn’t help, because in this case, the firstCol doesn’t work at all.
    As I see no one of default styles has such settings. So I doubt if it can be done at all.
    Do you have a solution?

    • I don’t recommend changing the order of the XML to try to solve problems. It can make the XML unreadable by Office programs.

      Table styles use a different XML part for table corners. These cells are referred to by point on a compass, so the upper left corner is referred to as the north west cell (a:nwCell). Corner cell formatting only becomes activated when both the interescting row and column are activated with the design options. For the upper left cell, this would be when both the Header Row and First Column options are turned on. Corner cell formatting goes at the end of the table style, which places it above the row and column.

      You would add a new XML section like this example:

      <a:nwCell>
        <!-- Corner cell XML goes here-->
      </a:nwCell>

      My ebook covers this in more detail.

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.