iframe tag

<iframe></iframe> tag is very useful when we want to display content from other web page in our page. <iframe> tag allows scrolling, so in this way, the data from other page can be fit in a small window.

Suppose we have an html file containing a large sized table

data.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table border="1">
<tr>
    <td>3</td>
    <td><a href="form1data.html">Form1</a></td>
</tr>

<tr>
    <td>34</td>
    <td><a href="form2data.html" target="_parent">Form2</a></td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>

<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>
<tr>
    <td>3</td>
    <td>asdfadsfasdf</td>
</tr>




</table>
</body>
</html>

We can show the data of above file in other html file using iframe tag:

index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

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

</body>
</html>

 

 

Tags:

Add a Comment

Your email address will not be published. Required fields are marked *