我在面板内部使用bootstrap表,如果包含长信息,则在面板外溢出,如何解决?
<div class="col-sm-3" role="complementary">
<div class="panel panel-default">
<div class="panel-body table-responsive">
<table class="table table-bordered table-condensed f11">
<tr>
<td colspan="2" align="center" class="info"><b>Info</b></td>
</tr>
<tr>
<td width="35%"><b>Agent</b></td>
<td width="65%">Luckystar Auto</td>
</tr>
<tr>
<td><b>WhatsApp</b></td>
<td>5412876542</td>
</tr>
<tr>
<td><b>WeChat</b></td>
<td>Luckystar88899</td>
</tr>
<tr>
<td><b>Facebook</b></td>
<td>www.facebook.com/luckystar88899-abcd</td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<p><div id="map-canvas"></div></p>
</div>
</div>
答案 0 :(得分:24)
由于网址链接太宽,会发生这种情况。
解决方法是使用CSS省略号根据需要截断单元格内容:
.table {
table-layout:fixed;
}
.table td {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}