我在表格单元格的内部显示了css值为display:none的div。当我$ .show()它时,单元格稍微向右扩展。当我使用visible属性而不是display:none时,这工作正常,但如果不需要,我不想保留高度。我尝试了各种显示属性以及重新排列CSS宽度,边距和填充以及删除背景图像。在调整大小的表格单元格内显示div
<div id='1'>
<table>
<tr>
<td>
<div class='container'>
<div class='error'>I am some long ass error that breaks my layout and I can't figure out what to do.</div>
<div>header</div>
<div>
<input type='button' value='add to cart'/>
</div>
</div>
</td>
<td>
<div class='container'>
<div class='error'>I am some long ass error that breaks my layout and I can't figure out what to do.</div>
<div>header</div>
<div>
<input type='button' value='add to cart'/>
</div>
</div>
</td>
<td>
<div class='container'>
<div class='error'>I am some long ass error that breaks my layout and I can't figure out what to do.</div>
<div>header</div>
<div>
<input type='button' value='add to cart'/>
</div>
</div>
</td>
</tr>
</table>
</div>
#1{width:400px;}
table {width:100%;}
tr {border: solid grey;}
.container{
border-right: 1px dotted #A5A5A5;
margin: 25px 0;
}
div {
display:block;
margin:auto;
text-align:center;
}
.error {
display:none;
padding-left:20px;
width:80px;
table-layout:fixed;
}
这里是一个fiddle showing the problem
好,我会张贴在元j08691但较少人会出现查看,因此没有真正改变使用的jsfiddle当具有格式化代码的需求压力较小。一个非常繁重的设计... –
我没有看到问题 – Rodolfo
我的不好,我没有更新小提琴,现在尝试链接。问题是,列更改大小 –