faqts : Computers : Programming : Languages : JavaScript : Tables

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

10 of 15 people (67%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

Is it possible to display other web pages in a cell?

Aug 13th, 2001 01:33
Ric Paton, Erik Szczepaniak,


The simplest way would be to put an <iframe> (or <ilayer> for NN4.x) 
tag into the cell and set the source of that tag to be webpage you want 
to display.

Example (for IE)...

---

<table>
<tr>
  <td id="URLCell"></td>
  <td>The webpage will show in the cell to the left</td>
</tr>
</table>

<script language="Javascript" type="text/javascript">
// the URL you want to show.
URL2Show = "http://www.faqts.com";
// the size of the frame
frameX = 200; frameY = 200;
// insert the <iframe> code
document.all.item("URLCell").innerHTML=
"<iframe src='"+URL2Show+"'width='"+frameX+
"' height='"+frameY+"'></iframe>";
</script>

---

...simply stick that code into an HTML page and you will see how it 
works. The <iframe> tag has some properties which allow you to alter 
the look and you can always use CSS definitions to alter it as well.

Hope that helps.

Ric.