我有以下HTML,在我的表中使用angularjs和twitter引导程序。
<div class="container-fluid" style="overflow:auto">
<table class="table table-striped" style="table-layout:fixed">
<tr ng-repeat='(key,val) in arr' class="row">
<td class="span1" style="width:150px;">
<h4>{{key}}</h4>
</td>
<td class="span1" style="width:150px;" ng-repeat='(nestedKey,nestedVal) in val'> <a href='{{nestedVal}}' target="_blank">{{nestedKey}}
<br>
<img src='{{nestedVal}}' style="width: 150px; height: 75px;" class="img-rounded"/>
</a>
</td>
</tr>
</table>
</div>
但是,overflow:scroll
会创建一个永远不会激活的虚拟滚动条。每当我调整浏览器的大小时,我的图像就会变得非常小,被压缩并相互重叠。
怎么了?
您可以min-width
在表格上使用css属性,从而在屏幕较小时使表格保持一定的最小宽度:
table{
min-width:800px;
}
另外,您也可以调整表格的布局/宽度以CSS media queries
用于移动视图:
@media all and (max-width: 800px){
/* your table specific query here */
}
最快的解决方案是您1
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句