Solved

IFrame and table alignment

Posted on 2003-11-12
3
2,255 Views
Last Modified: 2007-12-19
I am trying to use IFRAME in a ASP.Net page. Question has nothing to do with ASP.Net controls or anythng.

Design
---------
1.I need 2 frames on the page.
2. Both need to aligned side by side not stacked.
3. The left frame wil have table (rows and columns) with static text and can't be scrolled.
4. Right frame will have lot of columns corresponding to each row in left frame and will be scrollable (horizontal only).

Problem
----------

1. How do you make the two frames grow to the size of the table so that all rows are visible. By default IFrame shows up as small rectangle. So I tried to set the height to 100%. But that does not work because the content my be more than height of the browser window.
2. The top two rows in left frame will have no content whereas rows in right frame has images in top two rows with images. I know the max height of the content in rows in right frame. How do I communicate this height value to left frame. The height information will be known after all  data has been processed for right frame.
3. The right frame can have horizontal scroll bar where as left frame can't have. How do I align the two frames such that all rows are aligned to rows in left frame.

If you can provide me with some working javascript code or something, that will be great.

Let me know if you need more information.

thanks,


0
Comment
Question by:naveenkohli
  • 2
3 Comments
 
LVL 5

Expert Comment

by:prohacx
ID: 9738854
Hi there!

When trying this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> iframe test </TITLE>
</HEAD>

<BODY>

<iframe id="ifrm1" scrolling="no" style="border: 2px solid red; width: 150px; margin: 0px; padding: 5px;"></iframe>

<iframe id="ifrm2" scrolling="yes"  style="border: 2px solid blue; width: 300px; margin: 0px; padding: 5px;"></iframe>

</BODY>
</HTML>

I get 2 iframes next to eachother, with the right one having a scrollbar.

This should get you on your way...
0
 
LVL 23

Author Comment

by:naveenkohli
ID: 9740557
I am already on the way.... Using IFrame is not an issue for me. I am more interested in the alignment probelm solution.
I don't want to use fixed width/height, the way you have mentioned in your example.
0
 
LVL 5

Accepted Solution

by:
prohacx earned 500 total points
ID: 9745854
O.K.,

let me know if you need something else...

If you really want the iframes next to eachother, use a table with 2 columns and 1 iframe in each of them. That way the iframes will always be next to eachother. You can also use display:inline in the style attribute, but this will wrap if the browser is too small.

Bye!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now