CSS Attributes Index Box Attributes
Currently supported only in Internet Explorer® 5 up.
Sets or retrieves whether the table layout is fixed.
CSS |
{ table-layout : auto | fixed } |
Script |
table.style.tableLayout = sLayout ] |
auto |
The column width is determined by the widest unbreakable content in the column cells. |
fixed |
The table and column widths are set by either the sum of the widths on the COL objects or, if these are not specified, by the contents in the first row of cells. |
The property is read/write with a default value of auto; this attribute is not inherited.
Table rendering performance can be increased by specifying the tableLayout property. This property causes Internet Explorer® to incrementally render the table, providing users with information at a faster pace. Using the tableLayout property, the layout of a table is determined in the following order.
- From information in the width property for the COL or COLGROUP objects.
- By analyzing the formatting of the first table row.
- By an equal division of the columns.
If the content of a cell exceeds the fixed width of the column, the content will be wrapped or, if wrapping is not possible, it will be clipped. If the row height is specified, wrapped text will be clipped when it exceeds the set height.
Setting the property to fixed significantly improves the 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.
The following example shows how the CSS attribute can be used to fix the table layout.
<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>
Click the Show Me button to see a demonstration of the speed gains resulting from a fixed table layout.
This feature requires Microsoft® Internet Explorer® 5 or later.
Show me
currentStyle, runtimeStyle, style, TABLE
Enhancing Table Presentation, width