Microsoft has awarded Lene Fredborg, DocTools, the Microsoft MVP award for Word each year since 2008. Link to info about the MVP Award at Microsoft.com DocTools - document automation - add-ins, macros and document templates for Microsoft Word (logo) Document Automation
Add-ins & Macros
Document Templates
For Microsoft Word
Document automation, templates, add-ins, macros, for Microsoft Word (graphic)



Bookmark this page | Tip a friend about DocTools


Search thedoctools.com:

Custom Search



Word Tips about...

Table Cell Shading – White Space – Troubleshooting

When attempting to apply shading to tables, you may meet with the problem that one or more cells are not totally filled with the shading color – white space occurs, e.g. at the bottom of the cell. This article explains what can cause this problem and how to repair it.

Terms of use

You are welcome to use the macros and Word tips provided on this website. The contents is copyright. You may not reproduce any of contents (with or without modification or credits) elsewhere on the web, or on CD. Please link to the contents on this website instead.

Please note that all free Word tips, macros, add-ins and demos are provided "as is" and without obligation. See also detailed Terms of use.


You can apply shading to selected table cells via the Borders and Shading dialog box which you can open via Format > Borders and Shading (see Figure 1 below).

In case of Word 2007 or later version, you can open the dialog box as follows: Home tab > Paragraph group, click the arrow next to the bottom-right icon in the group and select Borders and Shading. You may also find Borders and Shading in the right-click menu.

On the Shading tab, you must select the color to apply. In addition, you must always remember to make the appropriate selection in the Apply to field. In relation to tables, you can apply the shading to:

BulletText (only available if you have selected text in the table)
BulletParagraph
BulletCell
BulletTable

Select the Table option if you want to apply shading to the entire table. If you want to apply shading to only some of the cells, select the Cell option whenever you want the shading to fill the entire cell. As you will see below, the Paragraph option may also in some situations result in filled cells.

Apply to options in Borders and Shading

Figure 1. The Borders and Shading dialog box with the four Apply to options.

Paragraph shading – what are the results?

If you apply shading to the paragraphs in a table cell, the shading will fill the entire cell if all of the following paragraph settings apply:

BulletLeft and right indent = 0
BulletParagraph space before = 0
BulletParagraph space after = 0
BulletAll cells in the same row have no cell margins

If one or more of the settings listed above do not apply, white space will occur in the table cell.

Space before and after and left and right indentation are defined via Format > Paragraph > Indents and Spacing tab.

In case of Word 2007 or later version, you can open the Paragraph dialog box as follows: Home tab > Paragraph group > click the little icon in the bottom-right corner of the group.

Paragraph space

Figure 2. The Paragraph dialog box.


In case of Word 2007 or later version, you can open the Table Properties dialog box as follows: while the insertion point is in a table, select the Layout tab > Table group > Properties. You may also find Table Properties in the right-click menu when the selection is in a table.

Cell margins for the entire table can be set via Table > Table Properties > Table tab > Options.

Table Properties, Table Options

Figure 3. The Table Options dialog box (opened from the Table tab).


Cell margins for individual cells can be set via Table > Table Properties > Cell tab > Options.

Table Properties, Cell Options

Figure 4. The Cell Options dialog box (opened from the Cell tab).


When will white space occur in table cells with paragraph shading?

As illustrated in the examples below, white space occurs in the table cell in the following situations:

BulletLeft and/or right indent is added to the paragraph(s)
BulletSpace is added before and/or after the paragraph(s)
BulletLeft and/or right cell margins are applied to the cell
BulletTop and/or bottom margins are applied to at least one cell in the row

Paragraph shading

Figure 5. Paragraph shading – examples. Note that the text in the upper-left cell consists of one paragraph which has been applied the listed settings.


Cell shading – what are the results?

If you apply shading to a cell in a table, the shading will fill the entire cell if the following settings apply:

BulletAll cells in the same row have the same bottom cell margin

Cell margins for the entire table can be set via Table > Table Properties > Table tab > Options. See Figure 3 above.

Cell margins for individual cells can be set via Table > Table Properties > Cell tab > Options. See Figure 4 above.

When will white space occur in table cells with cell shading?

NOTE: The white space issues illustrated below seem to apply only to Word 2003 and earlier versions. In Word 2007 and later versions, table cells seem to be filled correctly.

As illustrated in the examples below, white space occurs in the table cell in the following situation:

BulletDifferent bottom cell margins are applied to the cells in the same row

As can be seen from the examples below, space added before and/or after the paragraphs do not result in white space in the cell.

Note that left and/or right indentation of the paragraph(s) does not result in white space to the left and/or right. Also, any left and/or right margins added to the table cell via Table > Table Properties will not result in white space.

Cell shading

Figure 6. Cell shading – examples. Note that the text in the upper-left cell consists of one paragraph which has been applied the listed settings. As mentioned above, the cell shading white space issues only seem to occur in Word 2003 and earlier versions.


What happens if you apply mixed shading to a cell?

Not only can you apply different types of shading to table cells. You can also apply different types of shading to the same cell at the same time. This may make it more difficult to find out what causes white space in cells.

Imagine you have applied shading to the paragraphs in a table cell. The cell has white space so you find out that you should have applied the shading to the cell, not the paragraphs. Therefore, you select the cell, open the Borders and Shading dialog box, select the same color as applied to the paragraphs, select Cell in the Apply to field and click OK. You may then find that your table cell still has white space because the shading of the paragraphs is still in effect.

In Figure 7 below, this is illustrated by applying different colors. The upper-left cell is shaded yellow. The pink text is in a separate paragraph that has been applied text shading. The green and blue texts are individual paragraphs that have been applied paragraph shading. Since space has been added above/below those paragraphs, white space occurs even if shading has been applied to the entire cell.

NOTE: The white space issues illustrated below seem to apply only to Word 2010 and earlier versions. In Word 2013 and later versions, table cells seem to be filled correctly.

Mixed shading

Figure 7. Example of the result if a mixture of shading types is applied to the same cell.


If the same shading color is used for all shading in the example above, the result is as illustrated in Figure 8 below:

Mixed shading

Figure 8. The same example as in Figure 7 with the difference that only one color is used. In this case, it is difficult to find out what causes the white space.


Cell shading and paragraph styles with border(s)

White space in shaded table cells may also appear if you apply a paragraph style with one or more borders and space before/after. If that problem occurs, you need to remove the border(s) in order to solve the problem.

For details about how and when the white space appears when a bordered paragraph style is used, study the examples illustrated in Figure 9 below.

NOTE: The white space issues illustrated below seem to apply only to Word 2010 and earlier versions. In Word 2013 and later versions, table cells seem to be filled correctly.

Each example shows only a single table cell wth a black table border. The text in each table cell has been applied a paragraph style with one or more borders. The paragraph borders are red and blue. See the text in each example for further details.

Paragraph style with border(s) may cause white space

Figure 9. Using a paragraph style with border(s) may cause white space in table cells. As mentioned above, the cell shading white space issues in relation to borders only seem to occur in Word 2010 and earlier versions.


Tips on how to repair the shading if white space occurs

As illustrated above, you may find confusing results if you have a mixture of shading types applied to the same table cell.

Therefore, if you have problems with shading that does not fill one or more cells as expected, it would be an idea to:

BulletFirst remove all shading from the cell in question
BulletReapply shading to the table cell

In case of Word 2003 or earlier version:
BulletMake sure that all the cells in the row have the same bottom margin

Since the problem may also be caused by using paragraph styles with border(s), check for such paragraph borders and remove them if needed.

Related information

You will find details about working with tables in the article "Table basics" found at the Word MVP site.


Top of page

Back to Word Tips ...



Copyright © 2006-2017 Lene Fredborg – DocTools ApS – all rights reserved | Microsoft Word Templates – add-ins – VBA macros | Save time and work more efficiently in Microsoft Word
Privacy policy | Terms of use | Cookies policy | Bookmark this page | Tip a friend | Links | Contact