我試圖做一個表與自動溢出,但似乎並沒有工作。HTML和CSS表溢出不起作用
我現在擁有的一切:
<div class="panel-group col-sm-offset-1 col-sm-10">
<div class="panel panel-default">
<div class="panel-heading">
<i class="fa fa-folder-open-o fa-fw"></i>
<strong>Chatbox</strong>
</div>
<div id="forum4" class="panel-collapse collapse in" style="height:248px;">
<div class="table-responsive">
<table class="table table-hover" style="overflow:auto;max-height:248px;">
<thead>
<tr>
<th style="width:5%"></th>
<th style="width:81%;"></th>
<th style="width:5%;"></th>
<th style="width:8%;"></th>
</tr>
</thead>
<tbody>
<tr>
<td><b>Robin</b></td>
<td>Hier komt dan het bericht :D</td>
<td class="text-right"><small><a href="#"><i class="fa fa-warning" style="color: #CA2B2B;"></i></a></small></td>
<td class="text-right"><small>16 aug 18:51</small></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
這給了我我想要的完美的東西,除非它需要一個溢出。 因爲當它需要溢出時,它只是繼續前進,沒有任何溢出。
當我將display:block
添加到table
時,它確實有溢出(自動),但表格更短(http://prntscr.com/85c09y)。這就是我想要修復的問題,表格看起來像這樣:http://prntscr.com/85c1u6
我想要修復overflox y
,not overflow x
!
請你重現問題的小提琴.. – Lal
http://www.bootply.com/ittoDdbQY7是我現在有,這是我想要的:http://www.bootply.com/UVy7nJTCyl但是'溢出',並且當我不添加「isisplay:block」時它不起作用。 – Robin
@RobinR先生,您應該發佈演示,最好在https://fiddle.net或您自己的webspace上。我們至少需要所有這些類中的CSS。內聯樣式可能不是唯一影響你的表格的東西。我會給你一個答案,但請注意,這是完全基於你提供的信息,所以在應用到你的真實表格時它可能不起作用。 – zer00ne