table-layout Attribute | tableLayout Property

DHTML, HTML, & CSS

table-layout Attribute | tableLayout Property


Sets or retrieves whether the table layout is fixed.

Syntax

HTML { table-layout : sLayout }
Scripting table.style.tableLayout[ = sLayout ]

Possible Values

sLayout String that specifies one of the following values:
auto Column width is set by the widest unbreakable content in the column cells.
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.

The property is read/write with a default value of auto; the cascading style sheets (CSS) attribute is not inherited.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see dynamic propertiesInternet Link.

Remarks

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

  1. By using information in the width property for the COL or COLGROUP element.
  2. By using information in the 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 tableLayout property is set to fixed, the 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 browser's parser to begin rendering the row without having to examine the content of each cell in the row to determine row height.

Example

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

Sample Code

<TABLE STYLE="table-layout:fixed" WIDTH=600>
<COL WIDTH=100><COL WIDTH=300><COL WIDTH=200>
<TR HEIGHT=20>
<TD>...</TD><TD>...</TD><TD>...</TD>
</TR>
:
</TABLE>
This feature requires Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
currentStyle, runtimeStyle, style, TABLE

See Also

enhancing table presentationInternet Link, width


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.