Click to See Complete Forum and Search --> : Frames in a table


mizipzor
10-16-2007, 08:42 AM
On my page, I use tables to give it a nice blocky appearance. In the main "block" of the table, I want to put a frame, so I can therein display whatever content I see fit.

However, this doesnt seem possible, or Ive missunderstood the correct way to do it.

This is the code I use:

<table>
<tr>
<td height="540">
<div align="center">
<br>

<frame frameborder="0" noresize="1" src="home.html" name="mainframe">

<br>
</div>
</td>
</tr>
</table>

Using the firebug addon for firefox, it looks like the frametag is simply removed. Any ideas?

Fang
10-16-2007, 08:49 AM
You are confusing frames with iframes (inline frame). You probably require an iframe.
http://w3schools.com/html/html_frames.asp

mizipzor
10-16-2007, 08:56 AM
Thanks, did you mean to link here (http://w3schools.com/tags/tag_iframe.asp)? Or didnt you want to spoonfeed me entirely? ;)

mizipzor
10-16-2007, 09:04 AM
Thanks, that seems to be more what I want. But I want the frame to occupy the entire "block" in the table. I thought I could do this by setting height and width to 100%.

Is there a way to force a frame to occupy all space available, no matter how small the containing page is?

Source as of now:

<table>
<tr>
<td height="540">
<div align="center">

<iframe width="100%" height="100%" frameborder="0" src="home.html" name="mainframe" scrolling="auto"/>

</div>
</td>
</tr>
</table>

Fang
10-16-2007, 09:56 AM
If it's just an iframe in the cell it will fill the cell. Remove the div, it's redundant; if the iframe has width:100% then there's nothing to center.

mizipzor
10-16-2007, 10:04 AM
Thanks yet again. I just noticed a wierd thing, my first answer got posted. I was going to reply again with that second question and saw that my first answer wasnt there. I thought some error had occured. Thats why I said "thanks" twice btw. :p

Anyway, I ran into another problem with iframe, after the iframe tag, the last two <table> sections are ignored. Im validating the site right now but I cant see any errors that might cause this. And I found nothing on google that an iframe must be placed at the end of the document.

Fang
10-16-2007, 12:41 PM
Paste the full code or a link

mizipzor
10-16-2007, 01:06 PM
Ive solved it, if I close the iframe tag like this:

<iframe src="foo.html" />

The problem described above arises. But if I do this:

<iframe src="foo.html> </iframe>

It Works. I dont know why, but the important part is that it works and passes validation.