Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a specific iframe 2

Status
Not open for further replies.

Nate1749

Programmer
Nov 1, 2002
204
US
Is there way to print just a specific iframe that I have. I read something about creating a CSS file and hiding the other objects, but since I have a banner on top and a menu nagiviation bar on the left, I would think that this would make my iframe an extra inch in on the left and an extra inch down on top.

The navigation bar is like this

Security Policies
600
600.48
608.72


and once someone clicks on a security policy it's loaded into the main iframe. Sometimes they may want these printed and I don't want the whole webpage getting in the way. My only alternative I can currently think of is to have a small link next to the #s on the navigation bar that opens the link up in a new window if they want to print it; but that kinda defeats the purpose of having the tables with iframes, doesn't it?

-Nate
 
The main problem is the table on your index page. This is always visible in print and screen and if it is only there to position the two iframes it is un-necessary as they can be positioned without the table as follows
screen.css

Body {background-color: #ffffff; background-image: none}
#menu{scrolling="auto";position:absolute;left:10px;top:10px}
#cont{position:absolute;left:130px;top:10px;width:85%;height:100%;scrolling="auto"}

print.css

Body {background-color: #ffffff; background-image: none}
#menu{display:none}
#cont{height:100%;width:100%;scrolling="no";left:10px;top:10px}

index.htm

<head><title>Test</title></head>
<LINK rel=&quot;stylesheet&quot; type&quot;text/css&quot; href=&quot;print.css&quot; media=&quot;print&quot;>
<LINK rel=&quot;stylesheet&quot; type&quot;text/css&quot; href=&quot;screen.css&quot; media=&quot;screen&quot;>
<body>
<iframe id=&quot;menu&quot; name=&quot;menu&quot; framespacing=0 marginwidth=4 marginheight=0 width=&quot;120px&quot; height=&quot;100%&quot; frameborder=0 src=&quot;menu.htm&quot; onmouseout=&quot;focus('cont')&quot;></iframe>
<iframe id=&quot;cont&quot; name=&quot;cont&quot; framespacing=0 marginwidth=4 marginheight=0 frameborder=0 src=&quot;contents.htm&quot;></iframe>
</body>
</html>

I made no alterations to either of the other pages. Remember one of the reasons for using stylesheets is that elements can be accurately positioned on a page without the need to use tables

Hope this helps
Regards
Ian It's not a lie if you believe it!

| |
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top