Table not following width i set....

liunx

Guest
I want to have an iframe on my index page that goes to a page with one table that has a width of 244 (because any bigger, and it would have to scroll horizontaly in the iframe, and i dont want that). but no matter how much narrower i set the table width, most of the time, it still goes beyond 244 and makes the iframe scoll horizontaly....Here's the relevant bit of code in each page. <br />
<br />
Inside the index:<br />
<td><br />
<iframe src=http://www.htmlforums.com/archive/index.php/"iframe.html" name="MainIFrame" scrolling=auto width=244 height=211 frameborder=0>We are sorry but I IFrames are not compatible with your browser.</iframe><br />
</td><br />
<br />
<br />
inside iframe.html:<br />
<table width="244"><br />
<tr> <br />
<td width="244"> <br />
text goes here. <br />
</td><br />
</tr><br />
</table><!--content-->haha yeah may of us had problems with that before. ironically, setting it to "scrolling=yes" should work. you would think that this would definitely put a horizontal thing, but for some reason, it doesn't.<br />
<br />
its not the table thats too big. iframes do that for some reason. you can load a blank page and you'll still probably see a horizontal scrollbar.<br />
<br />
so set the attribute scrolling to "yes" and like before, make sure the table width is smaller than the iframe widht, and voila<br />
<br />
<!-- m --><a class="postlink" href="http://www.xdemi.com/main.html">http://www.xdemi.com/main.html</a><!-- m --><br />
Notice in my site, when you go to the source, the 7th to last line has an iframe. Scrolling is set to "yes" and only the vertical scrolling appears, but not the horizontal. the trouble with this might be that the vertical scrolling is always there.<!--content-->Take the bold out<br />
<br />
inside iframe.html:<br />
<table width="244"><br />
<tr> <br />
<td width="244"> <br />
text goes here. <br />
</td><br />
</tr><br />
</table><br />
<br />
:rocker:<!--content-->You will find it very hard to specifiy such an exact width in an iframe. The reason being that different browsers will have slightly different scrollbar widths.<br />
<br />
There are two ways around this... 1, have no scroll bar if the content will fit or 2 make sure you add the relavent width to the overall width to counter all scroll bars widths. I am not exactley sure what this common denominator is, but is probably around 20px. I have a referance at home... sure it covers such things and will post if it I find it.<!--content-->As promised...<br />
Widths for scroll bars.<br />
<br />
Windows:<br />
Netscape 6: 14x<br />
Netscape 4.7: 16px<br />
Internet Explorer 5, 5.5, 6 beta: 16px<br />
<br />
Macs:<br />
Netscape 6: 13px<br />
Internet Explorer 5: 16px<br />
Netscape 4.7: 15px<br />
Internet explorer 4.5: 15px<br />
<br />
The largest one is the common denominator... so add 16px, or IMHO 20px to be safe to the iframe.<!--content-->Originally posted by SolidCell <br />
I want to have an iframe on my index page that goes to a page with one table that has a width of 244 (because any bigger, and it would have to scroll horizontaly in the iframe, and i dont want that). but no matter how much narrower i set the table width, most of the time, it still goes beyond 244 and makes the iframe scoll horizontaly....Here's the relevant bit of code in each page. <br />
now correct me if I am wrong, but why would making it bigger make it scroll, it is the other way around, any smaller it will scroll.<br />
<br />
making it bigger only takes away the bottom scroll bar. making it smaller will make the scroll bar come back.<br />
<br />
generally the fast rule is if you have an iframe that has a bottom scroll bar then your content in that iframe is making it scroll, adjust this content and it will work.<!--content-->
 
Back
Top