2010-07-06 38 views
0

我有一個表格包含在一個div。 表格佈局是固定的。 div有css屬性「overflow:scroll」。 但是當我改變div的不到表格的寬度, 滾動條並沒有出現div有一張桌子在它不滾動

回答

1

指定某些widthheight到DIV,然後overflow:auto;

overflow:auto; 
width:500px; 
height:400px; 

檢查這個代碼

<style type="text/css"> 
    .pqr{ 
    overflow:auto; 
    width:500px; 
    height:400px; 
    } 
</style> 
<div class="pqr"> 
    <table width="600px" border="1"> 
    <tr> 
     <td> 
    Test 
     </td> 
    </tr> 
    </table> 
</div> 
+0

感謝你的答覆Salil。 我已經嘗試過「overflow:auto」,它在FF和IE中都不起作用:C 我會發布我的代碼。 – idiotgenius 2010-07-06 13:19:46

+0

@idiotgenius: - 檢查我編輯的答案 – Salil 2010-07-06 13:25:04

+0

是的!它的工作原理。但我的表格的寬度設置爲

Test
idiotgenius 2010-07-06 13:40:17