Solved

IFrame and table alignment

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

792 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