The table-layout property controls how a browser calculates column widths in HTML tables. It helps you choose between content-driven sizing and predictable, performance-friendly layouts.
01
auto
Content-based.
02
fixed
Preset widths.
03
Performance
Faster render.
04
Columns
Width control.
05
table
Set on table.
06
inherit
From parent.
Fundamentals
Introduction
The table-layout property in CSS is used to control the layout algorithm used for a table. It can speed up the rendering of large tables by letting the browser determine column widths without scanning every cell’s content.
This property is especially useful when working with tables that have complex content or require consistent column widths.
Definition and Usage
Apply table-layout directly to a <table> element. With auto, the browser sizes columns based on content. With fixed, column widths come from the first row, <col> elements, or explicit width values on cells.
For predictable layouts, set table-layout: fixed and give the table a defined width.
💡
Beginner Tip
Start with the default auto for small tables. Switch to fixed when columns should stay the same width or when a large table feels slow to render.
Foundation
📝 Syntax
The syntax for the table-layout property is straightforward. It is applied to table elements:
syntax.css
table{table-layout:value;}
Basic Example
fixed-table.css
table{width:100%;table-layout:fixed;}
Syntax Rules
Set the property on the <table> element, not individual cells.
Use fixed with a table width for reliable column sizing.
Define column widths on the first row, <col> elements, or cell width values.
The property is not inherited by default, but inherit is a valid keyword.
Related Properties
border-collapse — merges table borders
width — sets overall table and column sizing
word-break — handles long content in fixed cells
Defaults
🎯 Default Value
The default value of the table-layout property is auto.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
auto
Common values
auto, fixed, inherit
Works with
width, border-collapse, col elements
Set on
table elements
Inherited
No (unless using inherit)
Animatable
No
Reference
💎 Property Values
Value
Example
Description
auto
table-layout: auto;
The browser determines column widths from cell content. Can be slower for large tables because every cell may affect sizing.
fixed
table-layout: fixed;
Column widths are determined by the first row, col elements, or cell width values. The browser can render the table faster.
inherit
table-layout: inherit;
Inherits the table-layout value from the parent element.
autofixedinherit
Context
When to Use table-layout
table-layout helps you choose the right table rendering strategy:
auto — Small tables where content should determine column width naturally.
fixed — Dashboards, data grids, and admin panels that need stable column sizes.
fixed + width — Large tables where faster initial rendering matters.
fixed + ellipsis — Tables with long text that should truncate instead of stretching columns.
If columns look uneven with fixed, set explicit widths on the first row or use <colgroup> and <col> elements.
Preview
👀 Live Preview
Compare table-layout: auto and table-layout: fixed with the same cell content. Fixed columns stay equal width; auto columns grow with longer text.
auto layout
Header 1
Header 2
Header 3
Short
Content 2 with longer text
Short
Short
Short
Content 6 with even longer text
fixed layout
Header 1
Header 2
Header 3
Short
Content 2 with longer text
Short
Short
Short
Content 6 with even longer text
Hands-On
Examples Gallery
Compare auto and fixed layouts, set column widths, build a data table, and handle long cell content with fixed layout.
📜 Table Layout Modes
Demonstrate the difference between auto and fixed table layouts — matching the reference example.
Example 1 — Auto vs fixed table layouts
In this example, we’ll demonstrate the difference between auto and fixed table layouts on two similar tables.
Long descriptions show an ellipsis instead of widening the column.
How It Works
Fixed layout locks column widths, and overflow styles keep the table visually compact on narrow screens.
Companion
table-layout in the family
table-layout controls how columns are sized, but good table styling usually combines it with border-collapse for clean borders and a table width so fixed columns have a reference size.
The table element and its rows, columns, and cells form the layout structure.
Structure
2
Layout algorithm is chosen
auto scans content for widths. fixed uses the first row and width rules.
Algorithm
3
Columns are sized
Cells render inside the calculated column widths. Fixed mode can render before all content loads.
Sizing
=
📊
Predictable table layout
You control whether columns follow content or stay locked to your design.
Compatibility
Browser Compatibility
The table-layout property is well supported in all modern browsers, including Chrome, Firefox, Safari, Edge, and Opera. It is also supported in older browsers, making it a reliable property for cross-browser compatibility.
✓ Baseline · Universal support
Reliable across browsers
table-layout has been supported for many years in Chrome, Firefox, Safari, Edge, and Opera.
99%Modern browser support
Google Chrome1+ · Desktop & Mobile
Full support
Mozilla Firefox1+ · Desktop & Mobile
Full support
Apple Safari1+ · macOS & iOS
Full support
Microsoft Edge12+ · All versions
Full support
Opera4+ · Modern versions
Full support
Testing tip
Resize the browser window and compare the same table with auto and fixed to see how column behavior changes.
table-layout property99% supported
Bottom line:table-layout is safe to use in virtually all projects that include HTML tables.
Wrap Up
Conclusion
The table-layout property is a valuable tool for web developers when working with tables, allowing for more control over how tables are rendered.
By using the fixed value, you can improve the rendering performance of large tables and create a more predictable layout. Experiment with different values to see how they affect your tables and choose the one that best suits your needs.
Use fixed for large data tables and admin dashboards
Set a table width when using table-layout: fixed
Define column widths on the first row or with <col> elements
Pair fixed layout with ellipsis for long text in cells
Keep auto for small, content-flexible tables
❌ Don’t
Expect fixed to work well without any column width hints
Apply table-layout to individual cells instead of the table
Assume fixed layout improves performance if every column still has huge unbroken text
Forget accessibility — truncated text may need a title attribute or expandable row
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about table-layout
Use these points when building your next HTML table.
5
Core concepts
★01
auto Default
Content sizes cols.
Default
⚙02
fixed
Preset columns.
Mode
◉03
table element
Set here only.
Target
▦04
Performance
Fixed is faster.
Benefit
🔄05
border-collapse
Pair for styling.
Companion
❓ Frequently Asked Questions
table-layout controls the algorithm the browser uses to size table columns. It is set on the table element itself.
auto sizes columns based on cell content, which can be slower for large tables. fixed uses column widths from the first row or explicit width values for faster, more predictable layouts.
The default value is auto.
Use fixed when you want equal or predefined column widths, faster rendering on large tables, or consistent layouts regardless of cell content length.
No. table-layout only applies to table elements such as table, not to divs styled with display: table unless they use the table display type.