简体   繁体   English

Open Office XML / DrawingML中的表带

[英]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. 我正在玩PPTX文件到HTML的转换,并且遇到了Drawing ML表的问题,特别是行的带区。

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. 我有一张桌子,桌子上有3种不同的颜色,主要的主色调,Band1H行上的色调和Band2H行上的较浅色调。 The properties of the table specify that firstRow="1" and bandRow="1". 该表的属性指定firstRow =“ 1”和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. 我没有问题可以获取firstRow和Band1H的背景颜色,但是Band2H似乎只位于wholeTbl元素内,我理解(可能是错误地)除非所有表属性都被关闭,否则我无法读取。

Whats the proper way to get these styles? 获得这些样式的正确方法是什么?

Example image of table in question 有关表格的示例图片

Table from slide1.xml 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 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. 我相信这是直接在Powerpoint中构建的,因此样式实际上并未公开。 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 . 您正在寻找更轻的乐队是tint的值计算accent2schemeClrfilltcStyle 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. 您需要找到accent2的值并使用sRGB来计算tint ,在这种情况下为20%,如果任何值低于或高于则四舍五入为0.0或1.0。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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