tags:

views:

42

answers:

2
<td width="120" valign="top" height="100%">
   <iframe src="menu.php" width="100%" height="100%" frameborder="0">
   </iframe>    
</td>

This code always gives the default size of an iFrame in my browser (same as:

<iframe src="menu.php">
</iframe>

) I want the IFrame to get the size of the container cell.

I know I can use PHP for it to include a file on that place, but I want to create a long menu with scrollbars. Another solution to accomplish this would be nice too, because personally, I don't like IFrames.

Thanks,

Yvan

Edit: Now I've got this, and it doesn't display the div:

<html> 
<head > 
    <title>Untitled Page</title> 
    <style type="text/css"> 
        .scroller { height:100%; overflow:auto; }
    </style> 
</head> 
<body style="background-color: #7C70DA; font-family: Fixedsys, Courier, Courier New; text-align:center; vertical-align:center;"> 
    <center> 
        <div style="position:absolute; left: 40px; right:40px; top: 40px; bottom:40px; background-color: #3931A5; vertical-align:middle; color: #7C70DA "> 
            <table border="0"> 
                <tr> 
                    <td width="160" valign="top" height="100%"> 
                        <div class="scroller"> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 
                            Lipsum <br /> 

                        </div>  
                    </td> 
                    <td width="100%" valign="top"> 

                    </td> 
                </tr> 
            </table> 
            <br /> 
            (c) YVAN JANSSENS 2010      </div> 
    </center> 
</body> 
</html> 
+3  A: 

You can place the menu contents in a div, set the height of the div, and the overflow value to auto or scroll. As a side note, I'd like to encourage you to abandon this use of tables in HTML, and instead consider a CSS framework like the 960 Grid System for your layouts.

.scroller { height:500px; overflow:auto; }

--

<div class="scroller">
  <ul>
    <li>Options</li>
    <li>Options</li>
    <li>Options</li>
    <li>Options</li>
    <li>Options</li>
    <li>Options</li>
  </ul>
</div>
Jonathan Sampson
Could you give an example of that code?
Yvan JANSSENS
I think I did something wrong while implementing it... Look at the code I've added to my question...
Yvan JANSSENS
+1  A: 

In your second attempt you need to take the .scroller div out of the table, then it works, at least in Firefox 3.6.

Either way, the div is shown. What browser are you using?

I would also declare a doctype.

jeroen
I'm using Google Chrome (For Mac), though Safari has the same problems...
Yvan JANSSENS
Although I wouldn´t recommend a css framework (I prefer writing it myself), I would definitely get rid of the table and the center tag and use list as suggested by Jonathan Sampson.
jeroen