...

View Full Version : Iframe in table in ie7



sseebbee
11-09-2012, 07:22 PM
Hi!

Im trying to make an Iframe in a table and want to use the height 100% but I get a box insted that is around 150px and nomather what I set the % I always get the same size.

[<table width="70%" border="0" cellspacing="0">
<tr>
.
.
.
.
<td width="100%" height="100%" valign="top"><iframe name="inst" height="100%" width="100%"></iframe></td>
</tr>
</table>
</body>
</html>]

I have just a long line of td in the middle but nothing set to hight.

coothead
11-09-2012, 07:36 PM
Hi there sseebbee,

and a warm welcome to these forums. ;)

If I was asked to name the three worst things in the world, I would say, without hesitation...


an iframe, a table and IE7 :eek:

When using width="100%" or especially height="100%" for an element, you must make certain
that it's parent has a specified width or height value.

coothead

sseebbee
11-09-2012, 07:49 PM
Hi there sseebbee,

and a warm welcome to these forums. ;)

If I was asked to name the three worst things in the world, I would say, without hesitation...


an iframe, a table and IE7 :eek:

When using width="100%" or especially height="100%" for an element, you must make certain
that it's parent has a specified width or height value.

coothead

Thank you!

do you know if there is anyother way to make an iframe match the size of the screen while itīs in a td?

coothead
11-09-2012, 08:03 PM
Hi there sseebbee,

I certainly would not use the "table element" and although a little pained to use an iframe, I would code it like this...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">

<title>full size Iframe</title>

<style type="text/css">
html,body {
height:100%;
margin:0;
}
#container {
height:100%;
}
#container iframe {
display:block;
width:100%;
height:100%;
border:0;
}
</style>

</head>
<body>

<div id="container">
<iframe src="http://www.codingforums.com/showthread.php?t=281677" frameborder="0"></iframe>
</div>

</body>
</html>


coothead

sseebbee
11-09-2012, 09:40 PM
Hi there sseebbee,

I certainly would not use the "table element" and although a little pained to use an iframe, I would code it like this...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">

<title>full size Iframe</title>

<style type="text/css">
html,body {
height:100%;
margin:0;
}
#container {
height:100%;
}
#container iframe {
display:block;
width:100%;
height:100%;
border:0;
}
</style>

</head>
<body>

<div id="container">
<iframe src="http://www.codingforums.com/showthread.php?t=281677" frameborder="0"></iframe>
</div>

</body>
</html>


coothead


Thx that worked but I didnīt get it to work within a td. I need the iframe+a meny to be centered next to eachother at the same height. If you want I can send the whole coding of the page and you can see what I mean?

coothead
11-10-2012, 10:28 AM
Hi there sseebbee,

sorry, but I do not code for table layouts or IE 7 but, if I am feeling a little lackadaisical,
I will occasionally provide code for an iframe. ;)

Someone else may wish to help you, but whilst waiting you could read some of these links...

Why tables for layout is stupid: problems defined, solutions offered (http://www.hotdesign.com/seybold/index.html)
Ten ways to speed up the download time of your web pages (http://www.webcredible.co.uk/user-friendly-resources/web-usability/speed-up-download-time.shtml)
Nested Tables: About the (ab)use of tables as layout tools in webpages. (http://www.dorward.me.uk/www/nested/)
Why Tables Are Bad (For Layout) Compared to Semantic HTML + CSS (http://www.phrogz.net/CSS/WhyTablesAreBadForLayout.html)
Why go table free? (http://www.workingwith.me.uk/tablefree/why/)
Why avoiding tables (for layout) is important (http://davespicks.com/writing/essays/notables.html)

coothead



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum