Welcome to MSDN Blogs Sign in | Join | Help

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:

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


(Click to enlarge)

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


(Click to enlarge)

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


(Click to enlarge)

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.


(Click to enlarge)

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


(Click to enlarge)

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

That wraps up tables for now.

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

Comments

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

Monday, November 07, 2005 6:58 PM by Chartman
This is a dream come true. It may just save me from developing carpel tunnel syndrom. Thanks!

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

Tuesday, November 08, 2005 5:01 AM by Nigel Harper
Dave,

I have never really used styles in the past precisely because of the limitations about inserting new rows or deleting existing ones etc. I can see these new dynamic ones as being very useful.

Can the printing of these 'auto-styled' formats be switched of. Often what one wants on screen and the printed page are different things. Printouts can quickly become cluttered with too much going on on the page.

One of the main things I do is to highlight input cells (cells without precedents) in one colour and output cells (cells without dependents) in another. Input cells I divide into two types where one is a result of a query and the other is a cell into which the user types directly. A style which could do this kind of detection and highlighting work would be very useful. I find that once users pick up on these styles and their meanings they are adopted very quickly and it helps when sheets are doing the rounds and being viewed and updated by more than one user.

This may all fall under formula auditing and precedent/dependent detecting so you may have more to say on this at a later stage. Will you be covering these issues and calculation engines any time? I still cannot see how Excel 12 is going to deal with a, say, 10-nested IF array formula scanning 500000 rows when it already struggles (timewise) to deal with a 3-nested IF array formula over just 5000 rows. All the new specs and multi-threading, dual-core handling will be for nought if it takes half an hour to calc a single column of cells.

Thanks again,
Nigel

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

Tuesday, November 08, 2005 12:43 PM by Syndrome
And when everyone's super... (laughs maniacally)... no one will be.

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

Tuesday, November 08, 2005 2:05 PM by Tianwei
David, wrapped up tables already? Is pivottable going to be a section of its own?

When do you plan to unveil the new charting?

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

Tuesday, November 08, 2005 6:21 PM by Jean Martineau
Nice improvement David.

|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.
In some tables, it would be nice if we could have more than one "first column".

Jean

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

Tuesday, November 08, 2005 8:44 PM by David Gainer
Howdy folks, thanks for the kind words.

Nigel – You can turn the styles off and then print, and there is another solution I can think of that I will cover later when I talk about themes, but these styles are formatting, so the default behaviour is to print, just like “direct” and conditional formatting. Also, we have improved cell styles, and they will now include styles for things like input, output, calculation, linked, check, and external data cells. Are there others you use typically? (More on cell styles in a later post too.) With regards to the calculation engine, we do further performance tuning each version, but the largest performance gains this version will come from multi-threading.

Tianwei – PivotTables are definitely going to get a lot of posts of their own … lots and lots of features left to cover. New charting around Christmas at current pace.

Jean – Thanks for the feedback.

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

Wednesday, November 09, 2005 12:29 AM by Jason Moser
Will the table definition be adjustable to deal with multiple header rows? If for example I have 2 rows of titles (with a higher level grouping and then the titles themselves) then will I be able to define this?

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

Wednesday, November 09, 2005 4:38 AM by Jean-Marc Decouleur
Hi David,

That's good stuff. Would be nice to have specific formatting for freeze rows or columns (freeze panes) that are part of the table.
Also having a style that visually indicates when some rows or columns are hidden (or filtered) would be wonderful. That's one common issue with Excel beginners, they don't notice that some pieces of information are not currently displayed.

Jean-Marc

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

Wednesday, November 09, 2005 11:15 AM by David Gainer
Jason - not as currently implemented, though I have heard several requests for this revently.

Jean-Marc - thanks for the feedback. If you turn on headers and first columns and freeze panes where those intersect, I think you will get the effect you are looking for. Also, we have done work to try and make filtered rows more obvious (see autofilter improvements post).

# Excel 2007 documents – easy on the eyes

Monday, March 13, 2006 2:27 PM by Microsoft Excel 2007 (nee Excel 12)
One of the themes we focused on with Office 2007 was “great looking documents”.  For the next half-dozen...

# But wait, there’s more (styles) … Table Styles in Excel 2007

Friday, March 31, 2006 1:15 AM by Microsoft Excel 2007 (nee Excel 12)
Last post we looked at Cell Styles – both the changes we made to the feature as well as the set of Cell...

# Give us your thoughts on chart and table styles

Tuesday, May 23, 2006 2:39 PM by Microsoft Excel 2007 (nee Excel 12)
In previous posts, I have talked about new features we have added around chart styles and table styles. ...
New Comments to this post are disabled
 
Page view tracker