【问题标题】:how is td auto resized in this case?在这种情况下如何调整 td auto 的大小?
【发布时间】:2010-11-21 04:35:19
【问题描述】:
<body>
<table width="100%">
<tr>
<td><div>content1 goes here</div></td>
<td><div>content2 goes here</div></td>
<td><div>content3 goes here</div></td>
</tr>
</table>
</body>

内容(1,2,3)可以包含其他html标签。 td的宽度没有设置,那么它到底是怎么自动调整大小的呢? 我现在不知何故触发了意外的自动调整大小。

【问题讨论】:

  • 您能解释一下正在发生的自动调整大小吗?你想要什么行为?

标签: css autoresize html-table


【解决方案1】:

自动调整大小是浏览器处理表格方式的一部分。是否添加宽度都没有关系。 这将为您提供更深入的解释: http://www.w3.org/TR/CSS2/tables.html#model

【讨论】:

    【解决方案2】:

    如果您不希望 td 调整大小,则在 td 内的 div 上放置 宽度 标记并使其 溢出隐藏或省略号并将文本 innertext 作为工具提示显示到 div。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-02-05
      • 2015-08-11
      • 2020-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多