concept
Automatic table layout — CSS reference
Automatic table layout accounts for cell intrinsic size contributions and spanning constraints when determining column widths. CSS2 allows implementation latitude; do not assume a universally identical numeric distribution. The later 180px nonwrapping box increases the first column’s required width.
Formal Syntax & Structure
css syntaxcss
table { table-layout: auto; width: 240px; }Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>Automatic table layout</title><style>body{margin:0}#a{padding:8px;background:rgb(232,237,241);color:rgb(0,0,0);box-sizing:border-box}body{font:16px/20px sans-serif;background:white}#a{padding:0;background:transparent;margin:10px;color:black}table{border-spacing:0}td,th{padding:0}caption{padding:0}#a{table-layout:auto;width:240px}td{height:30px}</style><body><table id="a"><tr><td id="x">A</td><td id="y">B</td></tr><tr><td id="z"><span style="display:inline-block;width:180px">Long content</span></td><td>C</td></tr></table></body></html>