Jump to content

Div Height 100% Inside Td In Ie


thangaman
 Share

Recommended Posts

Hi, I have requirement for div inside the td should contain the 100% height. Pls find the code below: ----- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>HTML</title> <style type="text/css"> /* body{height:100%} - should not be used */ tr,td,table,div {height:100%;min-height:100%} </style> </head> <body> <table border="1" style="" cellspacing="0" cellpadding="0"> <tr> <td> Test 1<br/> Test 2 Test 2Test 2 Test 2<br/> Test 2<br/> Test 2<br/> Test 2<br/> Test 2<br/> Test 2<br/> </td> <td style=""> <div style=" background-color:#ff0000;border:1px solid #666"> Test 1 </div> </td> </tr> </table> </body> </html> ----- The above code satisfies the requirement in firefox 3+. But gracefully fails in IE(6,7,8).Note:1. First td content can increase @ any point of time because it contains dynamic content, so I can't keep height:#em or #px for div inside second td also.2. And doctype is must as loose.dtd.3. Script or expression should not be used.4. Need to achieve by css. Kindly help me to find the solution for this requirement. Thanks in advance Thangaman

Edited by thangaman
Link to comment
Share on other sites

well, a strict dtd will surely pull things in together more with IE.won't the td's expand as the content inside them expands?I think it's because it's having trouble trying to figure out 100% height when parent element(s) aren't defined explicitly themselves.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...