overflow:scroll;在< td> [英] overflow:scroll; in <td>

查看:168
本文介绍了overflow:scroll;在< td>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么CSS属性 overflow:scroll; < td> 中不起作用, $ c> overflow:hidden; 效果不错?

Why does the CSS property overflow:scroll; not work in <td>, while overflow:hidden; works well?

<table border="1" style="table-layout:fixed; width:100px">
  <tr>
    <td style="overflow:scroll; width:50px;">10000000000000000000000000000000000</td>
    <td>200</td>
    <td>300</td>
  </tr>
</table>

从CSS规格 1 2 ,我不明白为什么。

From the CSS specs1,2, I can't see why.

推荐答案

p>我得到了从这里的东西!

I got something from here!


Andrew Fedoniouk写道:

Andrew Fedoniouk wrote:


实际上我的问题:
一个技术原因是overflow属性不适用于
表。 - 为什么?这是什么原因?

This is actually my question: "One technical reason is that the overflow property does not apply to tables." - why? What is this reason?

我不是专家,但我相信这是
只是为了向后兼容
遗留表行为。你可以在规范中检查
自动表布局
算法。我很漂亮
确保这个布局算法是
与overflow
属性不兼容(或者更准确地说,
布局算法永远不会导致
的需要对于任何值溢出
除了'visible')。

I'm no expert, but I believe this is just for backward compatibility with legacy table behavior. You can check the "automatic" table layout algorithm in the spec. I'm pretty sure that this layout algorithm is incompatible with the overflow property (or, more accurately, the layout algorithm will never result in the need for any value of overflow except 'visible').


是的,这就是为什么我问。似乎没有正式的原因
为什么或不应该滚动,但似乎
UA供应商在这方面达成一些沉默的协议。

Yep, this is why I am asking. Seems like there are no formal reasons why or should not be scrollable but seems like UA vendors reached some silent agreement in this area. So is the question.

这个规范同意你对元素的尊重
。表单元格是
应该尊重溢出,虽然
Mozilla,至少,似乎没有做
所以。我不能回答你的问题在
这个实例,虽然我仍然
猜测答案仍然绑定到
遗产渲染。

The spec agrees with you with respect to elements. Table cells are supposed to respect overflow, although Mozilla, at least, appears not to do so. I can't answer your question in this instance, although I would still guess the answer is still tied to legacy rendering.

主线程是这里

这篇关于overflow:scroll;在&lt; td&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆