SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    100% div height within a table cell in IE?

    Hi guys...

    If you check out this code

    Code:
    <html>
    <head>
    <title>Test 8</title>
    <style type="text/css">
    	body				  { padding-left: 4&#37;;
    						 	padding-right: 5%;
    							height: 100%; }
    	div.sidebar			  { height: 100%;
    							width: 206px;
    							border: 3px solid blue; }
    	div.main			  { height: 100%;
    							float: left;
    							border: 3px solid red; }
    </style>
    </head>
    <body>
    
    	<table border="1">
    		<tr>
    			<td>
    				<div class="sidebar">
    					Side
    				</div>
    			</td>
    			<td>
    				<div class="main">
    					Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body<br/>
    					Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body<br/>
    					Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body<br/>
    					Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body<br/>
    					Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body Body
    				</div>
    			</td>
    		</tr>
    	<table>
    
    </body>
    </html>
    It works fine in Firefox, but (suprize!) not in IE. I'm trying to get the blue box, labeled "Side" to expand vertically with the table cell in which it is. Any ideas?

    Also, I'm not overly attached to doing it this way... if my goal can be accomplished using some other method, that would be fine.

    Thanks!
    -Stephen

  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The only reason you have it working like that is because it is proprietary HTML. Why use the table in the first place? You need to close the table if you open it. The table has no explicit height so the div will only stretch to fill the contents.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •