简体   繁体   中英

Table Banding in Open Office XML / DrawingML

I am playing with the conversion of PPTX files to HTML and am stuck on an issue with Drawing ML tables, specifically the banding of rows.

I have a table with 3 different colors, the main accent color, a tint on the Band1H row and a lighter tint on the Band2H row. The properties of the table specify that firstRow="1" and bandRow="1". I have no problems getting the background color for the firstRow and Band1H but the Band2H seems to only be inside the wholeTbl element, which I understand (maybe incorrectly) that I cannot read from unless all table properties are toggled off.

Whats the proper way to get these styles?

Example image of table in question

Table from slide1.xml

<a:tbl>
    <a:tblPr firstRow="1" bandRow="1">
        <a:tableStyleId>{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}</a:tableStyleId>
    </a:tblPr>
    <a:tblGrid>
        <a:gridCol w="1354667"/>
        <a:gridCol w="1354667"/>
        <a:gridCol w="1354667"/>
        <a:gridCol w="1354667"/>
        <a:gridCol w="1354667"/>
        <a:gridCol w="1354667"/>
    </a:tblGrid>
    <a:tr h="567215">
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h1</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h2</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h3</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h4</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h5</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h5</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
    </a:tr>
    <a:tr h="567215">
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>a</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>b</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>c</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>d</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>e</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>f</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
    </a:tr>
    <a:tr h="567215">
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>g</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>h</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" err="1" smtClean="0"/>
                        <a:t>i</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>j</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>k</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>l</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
    </a:tr>
    <a:tr h="567215">
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>m</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>n</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>o</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>p</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>q</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
        <a:tc>
            <a:txBody>
                <a:bodyPr/>
                <a:lstStyle/>
                <a:p>
                    <a:r>
                        <a:rPr lang="en-US" dirty="0" smtClean="0"/>
                        <a:t>r</a:t>
                    </a:r>
                    <a:endParaRPr lang="en-US" dirty="0"/>
                </a:p>
            </a:txBody>
            <a:tcPr/>
        </a:tc>
    </a:tr>
</a:tbl>

tableStyles.xml

 <a:tblStyle styleId="{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}" styleName="Medium Style 2 - Accent 2">
    <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="12700" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:left>
                <a:right>
                    <a:ln w="12700" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:right>
                <a:top>
                    <a:ln w="12700" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:top>
                <a:bottom>
                    <a:ln w="12700" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:bottom>
                <a:insideH>
                    <a:ln w="12700" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:insideH>
                <a:insideV>
                    <a:ln w="12700" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:insideV>
            </a:tcBdr>
            <a:fill>
                <a:solidFill>
                    <a:schemeClr val="accent2">
                        <a:tint val="20000"/>
                    </a:schemeClr>
                </a:solidFill>
            </a:fill>
        </a:tcStyle>
    </a:wholeTbl>
    <a:band1H>
        <a:tcStyle>
            <a:tcBdr/>
            <a:fill>
                <a:solidFill>
                    <a:schemeClr val="accent2">
                        <a:tint val="40000"/>
                    </a:schemeClr>
                </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:schemeClr val="accent2">
                        <a:tint val="40000"/>
                    </a:schemeClr>
                </a:solidFill>
            </a:fill>
        </a:tcStyle>
    </a:band1V>
    <a:band2V>
        <a:tcStyle>
            <a:tcBdr/>
        </a:tcStyle>
    </a:band2V>
    <a:lastCol>
        <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:fill>
                <a:solidFill>
                    <a:schemeClr val="accent2"/>
                </a:solidFill>
            </a:fill>
        </a:tcStyle>
    </a:lastCol>
    <a:firstCol>
        <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:fill>
                <a:solidFill>
                    <a:schemeClr val="accent2"/>
                </a:solidFill>
            </a:fill>
        </a:tcStyle>
    </a:firstCol>
    <a:lastRow>
        <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:top>
                    <a:ln w="38100" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:top>
            </a:tcBdr>
            <a:fill>
                <a:solidFill>
                    <a:schemeClr val="accent2"/>
                </a:solidFill>
            </a:fill>
        </a:tcStyle>
    </a:lastRow>
    <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:bottom>
                    <a:ln w="38100" cmpd="sng">
                        <a:solidFill>
                            <a:schemeClr val="lt1"/>
                        </a:solidFill>
                    </a:ln>
                </a:bottom>
            </a:tcBdr>
            <a:fill>
                <a:solidFill>
                    <a:schemeClr val="accent2"/>
                </a:solidFill>
            </a:fill>
        </a:tcStyle>
    </a:firstRow>
</a:tblStyle>

I believe this is built directly in the powerpoint, so the styles aren't actually exposed. Unfortunately this isn't something you can do.

You can see the list of available styles here .

The lighter band you're looking for is the tint value calculation of accent2 under schemeClr in fill in tcStyle . You'll need to find the value of accent2 and use sRGB to calc the tint , in this case at 20%, rounding to 0.0 or 1.0 if any values fall below or above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM