即使应用了高度,td背景也会延伸到tr中

时间:2013-02-07 14:56:38

标签: css mobile html-table

我的td设置了它们的高度,但是在我的iPad和iPhone等移动设备上,td背景和边框流出td并进入tr。我重新创建了我的确切代码,以向您展示我在桌面上看起来是什么样子,但正如您可以想象的那样,我的代码中可能存在一个错误,它允许它流入tr&#39>

#tstyle2 {
    width: 1000px;
    border-top: 1px solid #e8e6e6;
    border-bottom: 1px solid white;
}

#tstyle2 tr {
    height: 160px;
    border-bottom: none;
    border-collapse: separate;
    border-top: 1px solid white;
    border-bottom: none;
    width: 1000px;
}

#tstyle2 td {
    border-top: none;
    display: block;
    height: 130px;
    background-color: white;
    border-left: 4px solid #bd6ec1;
    box-shadow: 0px 3px 5px #b5b6b6;
}

http://jsfiddle.net/338cR/

1 个答案:

答案 0 :(得分:0)

我设法找到解决方案:

我必须添加

 display:block;

到#tstyle2 tr {}

然后添加

width: 1000px; 

到#tstyle2 td {}