From http://www.w3schools.com (Copyright Refsnes Data)

CSS table-layout Property


CSS Reference Complete CSS Reference

Definition

The tableLayout property sets the algorithm used to display the table cells, rows, and columns

Fixed table layout:

Automatic table layout:


JavaScript Syntax

CSS properties can also be dynamically changed with a JavaScript.

Scripting Syntax: object.style.tableLayout="fixed"

In our HTML DOM tutorial you can find more details about the tableLayout property.

In our HTML DOM tutorial you can also find a full Style Object Reference.


Example

table 
{
table-layout: fixed
}

Possible Values

Value Description
automatic Default. Column width is set by cell content
fixed Column width is set by table width and the width of the columns
 

Try-It-Yourself Demos

Set the layout of a table
This example demonstrates the fixed and the automatic table layout.


CSS Reference Complete CSS Reference

From http://www.w3schools.com (Copyright Refsnes Data)