Tables

To the extent possible, Microsoft Word saves tables using standard HTML elements and their attributes.

Cellpadding and cellspacing

Word imports cell padding settings, but exports this information using the style attribute in the TD element. Word saves the table cell padding options using the mso-padding-alt style attribute in the Table element.

Row height

In Word, the user can set the row height, which is stored using standard HTML in the style attribute of the TR element. To store the At least and Exactly settings for the row height, Word uses the mso-height-rule style attribute. In some cases, the height attribute of the TR element contains row height data for browsers that do not support this information in the style attribute.

Cell width

In Word, the user can set the cell width, which is stored using standard HTML in the style attribute of the TD element. In some cases, the width attribute of the TD element contains cell width data for browsers that do not support this information in the style attribute.

AutoFit

The AutoFit setting allows table columns to resize automatically according to their contents. This option is automatically enabled for Web tables, but Word still saves the cell width value to HTML. Word uses the mso-table-layout-alt style attribute to save AutoFit settings in HTML.

No wrapping

If a Word table cell has the cell wrapping disabled, the standard HTML nowrap attribute saves this to HTML.

Nested tables

Word uses standard HTML to save nested table information.

Diagonal borders

Word allows diagonal border lines in a cell. Since HTML has no mechanism for displaying these lines, Word uses the mso-diagonal-up and mso-diagonal-down style attributes to preserve them.

Table captions

When saved as HTML, table captions are contained in P elements before or after the table depending on the location specified.

Heading rows

In Word it is possible to designate one or more top table rows as the table heading. Such rows will appear at the top of every printed page if the table takes up more than one page. Word uses the Thead element to designate these rows.

Absolutely positioned tables

In Word, it is possible to position a table arbitrarily on the page. Word does not attempt to duplicate this positioning in the browser; however, it does save this information to HTML. Word uses the following style attributes to store table positioning information.

For information about the style attributes that Office uses and their possible values, see the Style Attributes topic.