Table Layout Property

Last updated: 2026-09-13

table-layout Table Layout Property

table-layout determines the algorithm used to compute table column widths. The default auto sizes columns based on content, so columns widen to fit large amounts of content. fixed sizes columns from the first row or from explicit widths, ignoring content, and renders faster — a good fit for large data tables.

Category
Initial Valueauto
InheritedNo
Applies To
Animation Type
CSS VersionCSS2
StatusStandard

📝 Syntax

table-layout: auto | fixed;

⚙️ Values

ValueTypeDescription
auto | fixedKeywordTable layout algorithm

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
table-layout v1 v12 v1 v1 v1
Supported in all major browsers
Tip: table-layout: fixed with width: 100% and width set on the first-row th quickly produces equal or proportionally distributed columns.

❓ FAQ

QWhat is the difference between table-layout: auto and fixed?
Aauto (the default): the browser walks every cell and computes column widths from content, so wide content stretches columns and can even break the container, and first render is slower. fixed: column widths come from the first row or explicit widths and ignore content, rendering faster; overflowing content can be handled with overflow or text-overflow.
QWhen should I use table-layout: fixed?
AUse fixed for large datasets, for fixed column widths, or when you need text truncation with text-overflow: ellipsis. It lets the first row determine widths, renders faster, and long content cannot blow out the table. Responsive tables also commonly use fixed with percentage widths for evenly distributed columns.
QWhy do my width settings not apply with table-layout: fixed?
AIn fixed mode, widths come from the first table row (usually th); widths set on td in later rows are ignored. To control widths, set them on the first-row th or use <colgroup> with <col>. If the first row sets no widths, columns are divided equally by the table's total width. This is the biggest behavioral difference from auto.
QCan table-layout: fixed solve content overflowing the table?
AYes. In auto mode long content stretches columns and can break the container; in fixed mode widths come from the first row, and content that overflows wraps by default or spills. Combined with white-space: nowrap, overflow: hidden, and text-overflow: ellipsis, you get single-line truncation with an ellipsis — the standard combo for very long text and table overflow.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏