<table width="400">
<tr>
<td width="100">A</td>
<td width="100">B</td>
<td width="100">C</td>
<td width="100">D</td>
</tr>
</table>
table { width: 400px; }
td { width: 100px; }
預設 `table-layout: auto` 時,若單元格內容(如長網址、大圖片)超過指定寬度,瀏覽器會**自動撐開**該欄,導致版面錯亂。
table {
width: 400px;
table-layout: fixed; /* 依 或第一列寬度固定,內容不再撐開 */
}
td {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { min-width: 600px; } /* 確保最小可讀寬度 */