When the content becomes too large vertically, I expect the vertical scroll bar to appear and the table to shrink horizontally slightly to accommodate the scroll bar. However in IE7 what happens is the horizontal scroll bar also appears, despite there still being enough space horizontally for all the content in the div.
This is IE specific - firefox works perfectly.
Full source below. Any help greatly appreciated.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Table sizing bug?</title> <style> #maxsize { position: absolute; left: 5px; right: 5px; top: 5px; bottom: 5px; border: 5px solid silver; overflow: auto; } </style> </head> <body> <form id="form1" runat="server"> <div id="maxsize"> <p>This will be fine until such time as the vertical size forces a vertical scroll bar. At this point I'd expect the table to re-size to now take into account of the new vertical scroll bar. Instead, IE7 keeps the table the full size and introduces a horizontal scroll bar. </p> <table width="100%" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td>A</td> <td>B</td> <td>C</td> <td>D</td> <td>E</td> <td>F</td> <td>G</td> <td>H</td> <td>I</td> <td>J</td> <td>K</td> <td>L</td> <td>M</td> <td>N</td> <td>O</td> <td>P</td> <td>Q</td> <td>R</td> </tr> </tbody> </table> <p>Resize the browser window vertically so this content doesn't fit any more</p> <p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p> <p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p><p>Hello</p> </div> </form> </body> </html>
0 nhận xét:
Post a Comment