2016-08-03 78 views
0

我[很遺憾]在桌子裏有一張桌子。外部表的最後<td>看起來像這樣:溢出:自動屬性只添加一個水平滾動條?

<td class="valign-top width-40 padding-right-4px"> 
    <div class="grid-filter-container" style="overflow:auto;"> 
     <table id="FilterColumns" class="fullwidth fimscaletable"> 
      <thead> 
       <tr> 
        <th class="width-25 textalign-left k-header k-grid-header"> 
         <span class="text-white">Field Name</span> 
        </th> 
        <th class="width-75 textalign-center k-header k-grid-header"> 
         <span class="text-white">Condition</span> 
        </th> 
       </tr> 
      </thead> 
      <tbody></tbody> 
      <tbody></tbody> 
     </table> 
    </div> 
</td> 

內部表編程方式獲取行添加到它,這是一個數據導出模塊的一部分。用戶會看到左側的字段列表,然後他們可以從列表中選擇它並設置一些參數並將其添加到右側的表格中。

如您所見,包含內表的<div>overflow屬性設置爲auto。但是在運行時它只有「收益」水平滾動條:

enter image description here

右邊的表開始爲大小相同左側的控制,但我添加更多的條件,它的增長身高。我希望它只是滾動div。請注意,此截圖是在IE中拍攝的;尚未測試其他瀏覽器。

grid-filter-container類定義爲這樣:

.k-window .grid-filter-container { 
    border: solid 1px #909090; 
    min-height: 200px; 
    padding: 0px; 
    margin: 0px; 
} 

JS小提琴實際上是由我公司的互聯網過濾器堵塞,否則我會盡量提供一個樣本。

+0

@AbhishekKumar'hidden'隱藏水平滾動條,但它仍然沒有給出一個垂直(我也不希望它?是不是點隱藏?它只是剪輯任何溢出) – sab669

回答

1

添加高度和容器

.k-window .grid-filter-container { 
border: solid 1px #909090; 
min-height: 200px; 
padding: 0px; 
margin: 0px; 
    height: 200px; 
} 
+0

謝謝!我添加了一個'height'並設置了overflow-x:hidden;',出於某種原因,它自動只是添加水平滾動條。儘管現在一切都很好。 – sab669