CSS tablelayout Property (original) (raw)

CSS table-layout Property

Last Updated : 22 May, 2026

The table-layout property in CSS is used to define the algorithm used for arranging table cells, rows, and columns. It controls how the browser calculates the width and layout of a table.

**Syntax:

table-layout: auto | fixed | initial | inherit;

**Default Value: Its default value is auto.

**Property Value:

**Example: This illustrates the use of the table-layout property where the values are assigned as auto & fixed.

HTML `

table-layout property
<style>
table {
    border-collapse: collapse;
    border: 1px solid black;
}

th,
td {
    border: 1px solid black;
}

table#table1 {
    table-layout: auto;
    width: 200px;
}

table#table2 {
    table-layout: fixed;
    width: 200px;
}

div {
    max-width: 200px;
    padding: 10px;
    border: 1px solid black;
}

h1 {
    color: green;
}
</style>

GeeksforGeeks

table-layout property

table-layout:auto;

Author Name Age College
RaviPratap Singh 24 GFG
Rakesh Singh 25 GEEKS

table-layout:fixed;

Author Name Age College
RaviPratap Singh 24 GFG
Rakesh Singh 25 GEEKS

`