Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iframe size on iPad

I have an HTML file as follows;

<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>

The iframe page delete2.html has a table of width = 846 i.e. it is more than the containing td width

So this only shows around 646 width of the iframe content on page load and rest scrolls..

But on the iPad, the complete 846px of iframe content gets displayed and it kind of appears to flow outside the table width..so it appears broken..

How can I fix this issue?

like image 492
copenndthagen Avatar asked May 26 '11 13:05

copenndthagen


People also ask

How do I make my iframe full size?

To size the <iframe> , we ignore the width="560" height="315" element properties, and instead use the CSS properties width:100%;height:100%; . That's it: a full-width <iframe> with fixed aspect ratio.

How do I make a iframe 16 9?

In the HTML, put the player <iframe> in a <div> container. In the CSS for the <div>, add a percentage value for padding-bottom and set the position to relative, this will maintain the aspect ratio of the container. The value of the padding determines the aspect ratio. ie 56.25% = 16:9.

How do you enlarge an iframe in HTML?

Edit the width attribute. You should see the attribute "width=" after the URL in the iframe tag. Edit the width in pixels in quotations (" ") after the "width=" attribute. For example, if you want the width to be 300 pixels, you would enter "width="300px"" after the URL in the tag.

Can you style the contents of an iframe?

You cannot change the style of a page displayed in an iframe unless you have direct access and therefore ownership of the source html and/or css files.


1 Answers

Starting in version 4.2.1 of Safari iOS, and still going as of 4.3.3, the entire content of an iFrame is forcibly shown. If your iFrame's content is in the same security sandbox as the outer page, you can surround the iframe with a div tag and use that to do the scrolling.

This fiddle doesn't work because of security sandbox restrictions, but it should work find for you if both pages have the same domain: iPad iFrame single finger scrolling

like image 115
CobaltBlueDW Avatar answered Oct 10 '22 23:10

CobaltBlueDW