昨天编辑了半天,发现文章超出了论坛限制,今天改成几篇来发。
本文逼格有点高,读者慎入。
我们在Excel里面使用表格,创建自己的表格样式是非常简单的事情(如下图所示,注意红线圈出的地方);Word里面也有表格样式,甚至内容更丰富。
然而,这么简单的功能,在PowerPoint里面却成为了黑客级别的技术!!!普通的PPT文档,是不能创建自定义表格的。虽然说,你用内置的某个表格样式后,可以编辑这个样式,但总归不如自定义的方便。
那能否创建自定义表格呢?答案是肯定的,需要通过修改PPT文档的xml代码来实现。下面的文字内容来自于老外博客,我偷懒用有道词典翻译过来了,可能个别的地方读起来怪怪的,但总归理解没有问题。
XML Hacking: Custom Table Styles Posted on July 13, 2015 - Updated on August 7, 2018 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! 对于品牌文档,您希望具有独特的表风格。Microsoft Office程序包括一堆表格样式,这些样式是由软件自动创建的,但它们都具有通用的MS外观。可以使用程序界面在Excel和Word中为Windows和Mac创建自定义样式。但如果使用PowerPopint,仍然可以创建自定义表样式。您只需要破解一些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. 首先,我们必须介绍Office程序如何创建自定义表。这不是一个简单的主题,但如果您试图在Word中为Windows或Excel创建自定义表样式,理解这一点也会有所帮助,因为Word或Excel实际上在各自的程序中都有实现这一点的工具。
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 让我们首先明确一件事:表样式不格式化表中包含的字体选择或大小。是的,我知道Word和Excel表格样式工具有字体格式下拉菜单,是的,我知道微软的帮助文件说字体样式包含在表格样式中。事实是,表格样式中的字体样式仅限于设置粗体或斜体属性、字体颜色以及表格组件是否使用标题或主体字体作为字体主题中的指定字体。有关字体和大小、对齐方式和重量/斜体控件,请阅读我在默认表文本上的文章
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和Excel中的表格样式对话框如何显示表格元素的。它类似于以XML自定义表样式输入信息的顺序。如果按照这个顺序,得到自定义样式所需的时间要比从偶数行和奇数行开始所需的时间短得多。
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 Word的自定义表样式存储在styles.xml文件中。这是在一个解压缩文件的word文件夹中。PowerPoint的类似文件在ppt文件夹中称为tableStyles.xml。XML在概念上是相似的,但是不同之处在于您不能从一个程序复制粘贴到另一个程序。如果您不确定在哪里可以找到这些文件,请阅读XML Hacking:An Introduction。如果您在Mac上编辑,还应该阅读XML Hacking: editing in OS X
Here's 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: 这是一个典型的PowerPoint表格风格。我把这个清单分成了4个部分,所以它适合放在页面上。将它们复制粘贴到一个列表中,或者以压缩文本文件的形式下载:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <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 >
未完,请继续阅读第2篇。
|