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
2010-07-06 13:12:54
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
2010-07-06 13:19:46
@idiotgenius:- check my edited Answer
Salil
2010-07-06 13:25:04
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
2010-07-06 13:40:17
sorry,I'm new here. I dont know how to post code like yours.sorry for my bad english too :D
idiotgenius
2010-07-06 13:42:14
what is col? why you need that? just USE <table border="1" width="600px" >
Salil
2010-07-06 13:49:10