Solved

IFrame and table alignment

Posted on 2003-11-12
3
2,256 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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 add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

777 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