Share via


tableLayout property

Sets or retrieves a string that indicates whether the table layout is fixed.

 

Syntax

Integer value = object.put_tableLayout( v);Integer value = object.get_tableLayout(* sLayout);

Property values

Type: BSTR

one of the values listed in Possible Values.

auto (auto)

Default. Column width is set by the widest unbreakable content in the column cells.

fixed (fixed)

Table and column widths are set either by the sum of the widths on the col objects or, if these are not specified, by the width of the first row of cells. If no width is specified for the table, it renders by default with width=100%.

String format

auto | fixed

CSS information

Applies To All elements
Media visual
Inherited no
Initial Value auto

Standards information

Remarks

You can optimize table rendering performance by specifying the IHTMLCSSStyleDeclaration::tableLayout property. This property causes the table to be rendered one row at a time, providing users with information at a faster pace. The IHTMLCSSStyleDeclaration::tableLayout property determines column widths for a table in the following order:

  1. By using information in the IHTMLImgElement::width property for the col or colGroup element.
  2. By using information in the IHTMLImgElement::width property for the td elements in the first row.
  3. By dividing the table columns equally, regardless of the size of the content.

If the content of a cell exceeds the fixed width of the column, the content is wrapped or, if wrapping is not possible, it is clipped. If the IHTMLCSSStyleDeclaration::tableLayout property is set to fixed, the IHTMLCSSStyleDeclaration::overflow property can be used to handle content that exceeds the width of a td element. If the row height is specified, wrapped text is clipped when it exceeds the set height.

Setting the property to fixed significantly improves table rendering speed, particularly for longer tables.

Setting row height further improves rendering speed, again enabling the parser to begin rendering the row without examining the content of each cell in the row to determine row height.

Examples

This example uses the CSS table-layout attribute to set the table layout to fixed.

<!DOCTYPE html>
<html>
<head>
  <title>table-layout</title>
</head>
<body>
  <table style="table-layout: fixed;">
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</body>
</html>

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

Reference

IHTMLImgElement::width

Conceptual

Enhancing Table Presentation