【问题标题】:Chromium ignores table height in css style or attribute heightChromium 忽略 css 样式或属性高度中的表格高度
【发布时间】:2014-03-14 14:46:13
【问题描述】:

我有 jQuery ajax 表格,我需要在表格主体未完全加载时保持表格高度。这是我的代码:

var tableHeight = parent.height();

// set parent fixed height so page don't jump up/down during adding
parent.height(tableHeight);
// or: parent.css("height", tableHeight + "px");

$tbody.hide().empty();
// no items loaded
if (rowsData.length === 0) {
    this._noItems();
} else {
    this._rowAdder(rowsData, actionDisplay);
}                                                                                

$tbody.show();                                                          
parent.height("auto");
  • “父”是表对象

我知道,我可以使用 css 属性“可见性”,但例如 Mozilla 不会更改 css 样式或表格属性并且表格显示效果很好。我的问题是:为什么 Chromium 会忽略配置的 CSS 样式或表格属性高度?有人可以帮我吗?这;)

【问题讨论】:

    标签: javascript jquery css chromium


    【解决方案1】:

    设置高度属性并不像设置宽度那么容易。

    在大多数情况下,如果您想让孩子知道 100% 的含义,您需要将 html 和正文高度设置为 100%。

    html,body{
       height: 100%;
    }
    

    【讨论】:

    • 谢谢,但很抱歉,此修复没有帮助。
    • 如果你可以包含一些 html 和 CSS 就可以了
    猜你喜欢
    • 2012-12-29
    • 1970-01-01
    • 2012-08-21
    • 2015-01-15
    • 1970-01-01
    • 1970-01-01
    • 2012-11-10
    • 2017-11-23
    • 1970-01-01
    相关资源
    最近更新 更多