Excel Home


译者:fanjy  来源:http://blogs.msdn.com/excel

Tables Part 7: Good-looking, well-behaved table formatting made easy …

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.
• 列表样式和单元格样式、图表样式、数据透视表样式以及文档主题一样,提供一组更便于操作的功能。更多的内容将在以后的文章中介绍。总之,我们所做的一切都是为了使用户能快捷的创建具有专业水准和外观协调的文档。

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).

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 …

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.

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

注:本文翻译自http://blogs.msdn.com/excel,原文作者为David Gainer(a Microsoft employee),Excel home授权转载。严禁任何人以任何形式转载,违者必究。


未经允许不得转载:ExcelHome » 精美实用的Excel列表格式,唾手可得

本站特聘法律顾问:李志群律师   沪ICP备11019229号-2

沪公网安备 31011702000001号