Solved

IFrame and table alignment

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

708 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

18 Experts available now in Live!

Get 1:1 Help Now