开发者

Question on displaying overflow (scrollbars)

开发者 https://www.devze.com 2023-03-08 18:24 出处:网络
I have a main page coded as follows; <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">

I have a main page coded as follows;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
 <table height="100%" cellspacing="0" cellpadding="0" border="0" width="646" class="data border">
            <tbody>
              <tr>
                <td valign="top" class="noPad">
                    <iframe height="100%" frameborder="0" width="100%" scrolling="no" name="studentFrame" src="delete2.html"></iframe>
                </td>
            </tr>
        </tbody>
</table>
 </body>
</html>

and the iframe page is coded as;

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>

 <body>
  <table height="100%" cellspacing="0" cellpadding="0" border="0" width="834" class="data border">
            <tbody>
              <tr>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>
                  <td>123</td>

              </tr>
            </tbody>
    </table>
 </body>
</html>

Now I wa开发者_JAVA技巧nt the iframe to scroll horizontally in the main page..

Will it scroll naturally as width of iframe is more than width of main containing table OR do we need to explicitly specify any attribute?

please help me. Thank you.


I wouldn't recommend putting I-frames in tables, or even using tables at all in this scenario.

You can disable overflow for elements on the main page: for the iframe and the table td. overflow:hidden;

And then for the body of your iframe page you can do overflow-x:scroll;

or you can try it for the actual iframe class.

0

精彩评论

暂无评论...
验证码 换一张
取 消