第四部分:
XML Hacking: Table Styles Complete
Posted on August 31, 2015 -Updated on January 19, 2019
Custom Table Styles are probably one of the moredetailed hacks you'll have to write. See the constructions details in my previous post. Besidesthe basic table format, there are 6 optional format layers you need to at leastconsider. In a minimal table style, you'll need to include at least the HeaderRow, First Column and Banded Rows. Most users will expect to see these options.Total Rows, Last Columns and Banded Columns are less requested, you only needto include them if a design or client specifically requires them.
定制表样式可能是您需要编写的更详细的技巧之一。请参阅我之前的文章中的构造细节。除了基本的表格格式之外,至少还有6个可选的格式层需要考虑。在最小表样式中,至少需要包含标题行、第一列和带状行。大多数用户都希望看到这些选项。总行、最后一列和带状列的请求更少,只有在设计或客户端特别需要时才需要包含它们。
As mentioned in part 1, if you haven't hacked XMLbefore, please read XML Hacking: An Introduction.If you're using a Mac, you should also read XML Hacking: Editing in OS X.In addition, an essential companion to this pair of articles is the post onsetting Default Table Text,which is set in a different XML component..
Let's take a look at how our work appears in thePowerPoint interface. First, we'll insert a plain vanilla table. By defaultthis takes on colors and fonts from the current PowerPoint theme:
正如第1部分中提到的,如果您以前没有破解过XML,请阅读XML Hacking: An Introduction。如果您使用的是Mac,还应该阅读XML Hacking: Editing in OS X.此外,这两篇文章的一个基本伴侣是关于设置默认表文本的文章,它是在另一个XML组件中设置的。
让我们来看看我们的工作如何出现在PowerPoint界面。首先,我们将插入一个普通的表。默认情况下,它采用当前PowerPoint主题的颜色和字体:
Next, we choose the Table Tools>Design tab, openthe Table Styles gallery. Up at the top a new Custom section has appeared withour new custom table style:
接下来,我们选择TableTools>Design选项卡,打开Table Stylesgallery。在顶部出现了一个新的自定义部分与我们的新自定义表风格:
Select the custom table style and the default tablechanges to match our design. This screen shot has all formatting options turnedoff, so effectively we are seeing the Whole Table formatting only.
选择自定义表样式和默认表更改以匹配我们的设计。这个屏幕截图关闭了所有格式化选项,因此实际上我们只看到整个表的格式化。
Options: Banded Rows and Header
Using the options panel in the upper left corner,we can add some of optional formatting layers we created in XML. First, let'sturn on banded rows. If you remember, we only formatted odd-numbered rows, sothe banding only changes rows 1 and 3 in our example:
选项:带状行和头文件
使用左上角的options面板,我们可以添加一些用XML创建的可选格式化层。首先,让我们打开带状行。如果你还记得,我们只格式化奇数行,所以在我们的例子中,条带只改变了第1行和第3行:
Next, we'll leave banded rows on and also add theHeader row. This row doesn't count as part of the table body, so the bandingmoves down 1 row:
接下来,我们将保留带状行,并添加标题行。这一行不作为表体的一部分,所以带向下移动1行:
Options: First and Last Columns
Next, we'll turn off banded rows, leave the Headeras is and add the first column:
选项:第一列和最后一列
接下来,我们将关闭带状行,保持标题不变,并添加第一列:
Here's the table with First and Last Columns checked:
Options: Header and Total
And finally, Header and Total Rows:
选项:Header和Total
最后,标题和总行:
As you can see, with some pre-planning, one tablestyle can cover quite a few related table looks. The layer options fordifferent features make the table useful for many different purposes and theoptions panel makes it fast and easy for users to try different combinations.This feature is a major advance over tables in PowerPoint 2003 and earlier,which were quite crude by comparison. Table styles work the same way in Word,PowerPoint and Excel. While Word and Excel include table style editors in theirinterface, PowerPoint needs to be hacked to create them. Happy hacking!
正如您所看到的,通过一些预先计划,一个表样式可以涵盖相当多的相关表外观。针对不同特性的层选项使表适用于许多不同的用途,而选项面板使用户可以快速、轻松地尝试不同的组合。与PowerPoint 2003和更早的版本相比,这个特性是一个重大的进步,相比之下,PowerPoint 2003和更早版本的版本相当粗糙。表格样式在Word、PowerPoint和Excel中工作方式相同。Word和Excel的界面中都包含了表格风格的编辑器,而PowerPoint需要破解才能创建它们。黑客快乐!
Of course, if the process is too complex, we'rehere to help. The current price on a custom table style is US$120. Just emailme
当然,如果这个过程太复杂,我们会在这里提供帮助。自定义桌面样式的当前价格为120美元。给我发邮件production@brandwares.com
原文中的截图都自动被删除了,没有关系,不需要。
下面的代码是我创建橙色自定义表格的xml代码,其中,我基于原文,增加了对第一行的参数设置——firstRow。
遗留的问题,表格里的文本格式没法修改!
<a:tblStyle styleId="{0817EA92-75D0-4044-A80A-AAA907CE0FDD}" styleName="Tiger Table Orange">
<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="20000" cmpd="sng">
<a:solidFill>
<a:srgbClr val="C8500E"/>
</a:solidFill>
</a:ln>
</a:top>
<a:bottom>
<a:ln w="20000" cmpd="sng">
<a:solidFill>
<a:srgbClr val="C8500E"/>
</a:solidFill>
</a:ln>
</a:bottom>
<a:insideH>
<a:ln w="0" cmpd="sng">
<a:solidFill>
<a:srgbClr val="7F7F7F"/>
</a:solidFill>
</a:ln>
</a:insideH>
<a:insideV>
<a:ln w="0" cmpd="sng">
<a:solidFill>
<a:schemeClr val="bg1"/>
</a:solidFill>
</a:ln>
</a:insideV>
</a:tcBdr>
</a:tcStyle>
</a:wholeTbl>
<a:band1H>
<a:tcStyle>
<a:tcBdr/>
</a:tcStyle>
</a:band1H>
<a:band2H>
<a:tcStyle>
<a:tcBdr/>
<a:fill>
<a:solidFill>
<a:srgbClr val="FCE9DC"/>
</a:solidFill>
</a:fill>
</a:tcStyle>
</a:band2H>
<a:band1V>
<a:tcStyle>
<a:tcBdr/>
</a:tcStyle>
</a:band1V>
<a:band2V>
<a:tcStyle>
<a:tcBdr/>
</a:tcStyle>
</a:band2V>
<a:firstRow>
<a:tcStyle>
<a:tcBdr>
<a:bottom>
<a:ln w="20000" cmpd="sng">
<a:solidFill>
<a:srgbClr val="C8500E"/>
</a:solidFill>
</a:ln>
</a:bottom>
</a:tcBdr>
<a:fill>
<a:solidFill>
<a:srgbClr val="DF590F"/>
</a:solidFill>
</a:fill>
</a:tcStyle>
</a:firstRow>
</a:tblStyle>
|