Table-Layout

How to layout table columns.

Syntax
      table-layout: auto | fixed | inherit ;

auto - Automatic table layout algorithm, the column width is set by the widest unbreakable content in the cells. (default)
fixed - Horizontal layout only depends on the table's width and the width of the columns, not the contents of the cells.
inherit - inherit from the parent element.

A fixed layout, in conjunction with setting a cell width will trigger the 'other table algorithm', browsers will then size based on the width, not the contents of the cells. Using a fixed layout, the entire table can be quickly rendered once the first table row has been downloaded.

Using an automatic layout, if some cell content is wider than that in the first row, then it will not fit in the calculated column width.

Examples:
td { table-layout: fixed; }
.emw3class { table-layout: auto; }

#emw3id { table-layout: fixed; }

Try it:

Top left content Top right content
Bottom left content that, being longer will tend to make this column wider. Bottom right content

(CSS 2) Browser Support: All major browsers.

“Never mind the quality: feel the width” ~ 1950s catch phrase

Related:

overflow - What happens if content overflows an element's box.
width - Width of an element.


Copyright © 2013-2022 Emw3.com
Some rights reserved