精美实用的Excel列表格式,唾手可得

网友投稿 366 2022-10-08

精美实用的Excel列表格式,唾手可得

译者:fanjy  来源:http://blogs.msdn.com/excel 发表于:2006年7月7日

Tables Part 7: Good-looking, well-behaved table formatting made easy … 列表(第7部分):精美实用的列表格式,唾手可得

If you’ve been reading the last few posts on tables, you may have noticed that the screenshots all had tables with formatting applied to the entire table. You may have thought I spent lots of time manually formatting the tables to look nice for this blog but in fact I hardly lifted a finger – I was using a brand new table feature in Excel 12 called “table styles” which made it possible to add formatting with one click. Table styles is a feature that provides a way to quickly format my entire table using a preset style definition. It is similar in concept to the AutoFormat feature Excel had in the past, with a couple key differences: 如果你已经读过上篇介绍列表的文章,你可能已注意到了应用于整个表格的所有列表格式的截图。也许你会认为,我为了使博客中的列表精美而花了大量的时间手工对列表进行格式化操作,实际上,我轻而易举地就获得了列表的精美效果——我使用了一种在Excel 12中被称作“列表样式”的新功能,运用它只需一次单击鼠标就可以添加格式。列表样式提供了一种应用预先设置的样式来快速格式整个表格的方法,与Excel原有的自动套用格式功能相似,主要的不同是:

• Table styles are dynamic, not a one-time formatting operation, so the formatting associated with the style behaves intelligently through many table actions – addition or deletion of rows or columns, sort, filter, etc. • 列表样式是动态的,不只是以前的格式化操作。即格式与样式能在列表的操作中协同工作——添加或删除行或列,排序,筛选等等。 • There will be a healthy variety available. Excel 12 will ship with 30-40 table styles out of the box, and users will be able to vary the colours used by the style, so users will have a couple hundred styles available with one or two clicks of the mouse. If none of the built-in styles tickle your fancy or suit your presentation, you will be able to create your own custom styles which are sharable with others. • 有大量各种各样可用的样式。Excel 12将发布30—40种列表样式(译者注:在后面的一篇文章中谈到了是50种),并且用户能对(相同的)样式使用不同的颜色,因此,只需通过一次或两次单击就可得到上百种可用的样式。如果你不满意这些内置的样式或者它们不适合你的演示文档,你能创建自定义样式并与他人分享。 • The UI for applying styles – galleries in the ribbon – is a big step forward. This is a great example of the kinds of benefit the ribbon brings to Excel. • 极大的改进了用于操作样式的用户界面——(列表样式)在ribbon(工具栏)的galleries(图形目录)中。这是ribbon(工具栏)能使Excel更易被操作的一个极好的例子。 • They are part of a broader set of work that includes cell styles, chart styles, PivotTable styles, and document themes. More on that in later posts, but the goal of all this work is to make it fast and easy to create professional-quality, consistent-looking documents. • 列表样式和单元格样式、图表样式、数据透视表样式以及文档主题一样,提供一组更便于操作的功能。更多的内容将在以后的文章中介绍。总之,我们所做的一切都是为了使用户能快捷的创建具有专业水准和外观协调的文档。

精美实用的Excel列表格式,唾手可得

Table styles are easy to apply – all you need to do is create a table, and a default table style is applied as soon as a table is created (don’t worry though, it doesn’t remove your existing formatting). If you don’t like the table style, you can pick something different or remove it altogether. The gallery of table styles is available directly from the table style ribbon. By default, we show you a single row of styles (the number depends on the resolution of your screen – more resolution, more space for styles). 应用列表样式是很容易的——你只需创建一个列表后应用缺省的列表样式即可(不必担心,这样的操作不会取消已有的格式)。如果你不喜欢(已应用的)列表样式,你可以选取其它的样式或者完全消除已应用的样式。可以直接从列表样式ribbon(工具栏中)的gallery(图形目录)中应用列表样式,在缺省的界面中显示了一行样式(显示的样式数量取决于你的屏幕分辨率——分辨率越大,列表样式显示得越多)。

If you want to see other styles, you can either scroll, or click on the drop-down to see all the styles available. (Note – the stuff you see in the screenshot are just place-holder styles that will be updated after further design work. I am very interested to hear any comments or feedback about what sort of formatting people use for their tables.) 如果你想看到其它的列表样式,你能使用滚动条或者单击下拉箭头来显示全部可用的列表样式。(注:下面的屏幕截图中所显示的不是最终所有的样式,我们将在做进一步的设计后对样式进行更新。我非常乐意听到您在列表中使用何种样式的意见或反馈。)

As I hover over each table style with the mouse, Excel shows me a preview of what my table looks like with that style. The preview appears directly on the table in my spreadsheet – it is not a separate image. This is another of the user interface advancements we have made with the new ribbon feature in Office. If I like how the preview looks, I simply click on it to officially apply it to my table. (This behaviour will show up a lot of places, and in more apps than just Excel. I will review some further examples in later posts.) 当把鼠标放置在每个列表样式上时,Excel显示列表在应用该样式后的预览。预览直接显示在电子表格的列表中——不是单独的图像。这是在Office中新的ribbon(工具栏)功能基础上对用户界面所作的又一改进。如果喜欢预览显示的样式,你简单地单击样式就会对列表正式运用该样式。(这个功能也设置在了Excel 2007中的其它一些地方,并且在其它的应用程序中也设置了这个功能。我将在后面的文章中列举更多的例子。)

To sum, one of the benefits of this feature is that professional-quality formatting is one click away. The fun is only starting, however. Once a table style is applied, it will grow and shrink with the table as the table changes (I showed examples of this in my previous posts). Additionally, certain elements of table style formatting have other intelligent behaviors. For example, if a table style specifies what we call “banded row” formatting, meaning that every odd row be one color and every even row be another color, then that banding rule will always apply no matter what I do to the table. This means I can add and delete rows and my table still appears properly banded. I can sort and filter a table and my rows will still appear properly banded. (Note – filtering is one place where the technique of using “=MOD(ROW(), 2)” in a conditional formatting rule to generate bands doesn’t work – since filtering hides rows, the banding effect is destroyed.) For example, if my table looks like this before filtering … 总的说来,这个功能的一个优点是只需一次单击鼠标就可得到具有专业水准的格式。然而,这仅仅是开始。一旦应用了某个列表样式,那么在列表变化时,(所应用的)样式(范围)也将随列表而扩大和收缩(在我以前的文章中已经举过一些这方面的例子)。此外,列表样式格式选项中的参数具有某些智能功能。例如,如果某个列表样式开启了“给行加底纹”的格式,那将使列表中每个奇数行显示一种颜色,其它行显示另一种颜色,并且不管我们对列表做什么操作,加底纹规则总是应用在列表中。即在列表中添加和删除行后列表仍然按规则合适地显示条纹。同理,排序和筛选列表后列表行仍按规则合适地显示底纹。(注:(与列表样式相比较)在条件格式中运用”=MOD(ROW(),2)”函数技术生成的底纹在筛选后是不起作用的——由于筛选隐藏了行,底纹效果无效。)例如,筛选前的列表如下图所示:

Before Filter 筛选前

… and I filter out all even-numbered rows, here is what my table will look like after I filer it: 筛选掉所有的偶数行后的列表如下图:

After Filter 筛选后

Table styles have several different options that can be turned on and off, and all of them have similar intelligent behaviors. For example, a table style might define that the first column should always appear a certain way. If the “first column” option is enabled, then Excel will always make sure the first column is formatted appropriately no matter which column is in the first position. You can see the other table style options in the screenshot below – header and total rows, first and last columns, and banding on either rows or columns. You can toggle these on and off for each table style. 能开启和关闭列表样式中的几个不同的参数选项,这些选项都具有相同的智能功能。例如,一个列表样式可以规定第一列总是显示某种格式。如果开启“突出第一列”选项,那么不管哪列在开始的位置,Excel将总是确保适当地格式第一列。下面的屏幕截图显示了其它列表参数选项——表格标题和汇总行、突出第一列和最后一列,给行或列加底纹。你能在每个列表样式中开启或关闭这些选项。

One question we hear a lot when we are showing off table styles is how it relates to “direct” (user-applied) formatting and conditional formatting. If a table style is applied, you are still free to format your table using either conditional or direct formatting. Formatting that you directly apply to a table will always appear “above” formatting that is defined by a table style, and conditional formatting will always appear “above” direct, or user-applied formatting (bold for example). 我听到的最多的问题之一是,列表样式与直接(用户应用的)格式和条件格式有何关系。如果应用了某个列表样式后,你仍能自由地应用条件格式或直接进行格式化操作来格式列表。它们之间的优先顺序是,条件格式优于直接的(或用户应用的)格式,直接的(或用户应用的)格式优先于列表样式。

Finally, I want to briefly cover the elements of a table style and the UI to create your own. When creating a table style, you can specify formatting for the following elements (all are optional, and there is an order of precedence, so, for example, header row formatting shows up “above” whole table formatting): 最后,我想简要地介绍创建你自已的列表样式参数和用户界面。在创建一个列表样式时,你能使用下列参数来指定用于样式中的格式(所有的参数都是可选择的,并且有优先顺序,例如,标题行格式优先于整个列表格式): • Whole table (突出)整个列表 • First row stripe 第一行底纹 • Second row stripe 第二行底纹 • First column stripe 第一列底纹 • Second column stripe 第二列底纹 • Header row 标题行 • Total row 汇总行 • First column (突出)第一列 • First header cell (突出)第一个标题单元格 • First total cell (突出)第一个汇总单元格 • Last column (突出)最后一列 • Last header cell (突出)最后一个标题单元格 • Last total cell (突出)最后一个汇总单元格

The dialog that you use also lets you name the style, see a preview, and set the “Stripe Size” for bands (UI still being finalized). 你也可以应用下面的对话框命名列表样式,对话框中有预览框和”底纹尺寸”设置(用尺界面还未最终确定)。

Note that part of what the “options” I describe above does is simply turn on or off formatting of these elements – for example, if you turn off the “First Row” check box, Excel 12 will not show any of the first column/first header cell/first total cell formatting. (Some of you may have been noticed the table has a gradient fill. That’s another new formatting capability in Excel 12.) 我在上面描述的部分选项只需简单地开启或关闭这些参数格式——例如,如果关闭“突出第一行”复选框,Excel 12不会突出显示任何的第一列格式/第一个标题单元格格式/第一个汇总单元格格式。(你可能注意到表格有一个渐变填充,这是在Excel 12中的一个新的格式功能)

That wraps up tables for now. 目前与表格相关的内容就是这些。

Published Monday, November 07, 2005 11:43 AM by David Gainer

非常感谢Kevin的帮助和指导!

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:介绍Excel服务
下一篇:移除重复的Excel列表(和区域)记录
相关文章