【发布时间】:2013-07-10 08:32:35
【问题描述】:
我有一个有两行的表。第二行由 colspan="2" 中的长文本组成。如何包装此文本以使表格不比两个第一行单元格宽?我无法为表格设置固定宽度,因为前两个单元格是动态的。
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td colspan="2" style="width: 0" >Very long cell that should just be as long as the first two cells and wrap, but not take all the screen width.</td>
</tr>
</table>
我错误地认为style="width: 0" 会在那个单元格上工作。
【问题讨论】:
-
你用的是哪个版本的html?
-
当前浏览器中的 HTML5。
标签: html html-table word-wrap