tags:

views:

28

answers:

1

I have a table contained in a div. table layout is fixed. div has css property "overflow:scroll". but when I change div's with less than table's width, scroll bar did not appear

+1  A: 

specify certain width, height to DIV and then overflow:auto;

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

check this code

<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>
Salil
thanks for your reply Salil.I have tried "overflow:auto", it did not work, both in FF and IE :CI will post my code leter.
idiotgenius
@idiotgenius:- check my edited Answer
Salil
Yes! it works.But my table's width is set on <col> <style type="text/css"> .pqr{ overflow:auto; width:500px; height:400px; } </style> <div class="pqr"> <table border="1"> <col width="600px" <tr> <td> Test </td> </tr> </table> </div>
idiotgenius
sorry,I'm new here. I dont know how to post code like yours.sorry for my bad english too :D
idiotgenius
what is col? why you need that? just USE <table border="1" width="600px" >
Salil