Definition and Usage
The table-layout CSS property defines the algorithm to be used to layout the table cells, rows, and columns.
- Initial auto
- Applies to table and inline-table elements
- Inherited no
- Media visual
- Computed Value as specified
- Animatable no
- Canonical order the unique non-ambiguous order defined by the formal grammar
Syntax
Formal syntax: auto | fixed
table-layout: auto
table-layout: fixed
table-layout: inherit
Values
- auto
- An automatic table layout algorithm is commonly used by most browsers for table layout. The width of the table and its cells depends on the content thereof.
- fixed
- Table and column widths are set by the widths of table and col elements or by the width of the first row of cells. Cells in subsequent rows do not affect column widths.
Under the "fixed" layout method, the entire table can be rendered once the first table row has been downloaded and analyzed. This can speed up rendering time over the "automatic" layout method, but subsequent cell content may not fit in the column widths provided. Any cell that has content that overflows uses the overflow property to determine whether to clip the overflow content.
Examples
.contentbox {
table-layout: fixed;
}
Compatibility
Desktop browsers
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|
Basic support | NA - 14.0 + | 1.0 (1.7 or earlier) | 5.0 | 7.0 | 1.0 |
Mobile browsers
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|
Basic support | NA 1.5 | NA | NA | NA | NA 9.8.0 | NA 3.0 |