thangaman Posted November 12, 2009 Share Posted November 12, 2009 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 Link to comment Share on other sites More sharing options...
thescientist Posted November 12, 2009 Share Posted November 12, 2009 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.