IE7 Tables

Author Message
swiftoid

  • Total Posts : 41
  • Scores: 0
  • Reward points : 0
  • Joined: 10/20/2006
  • Status: offline
IE7 Tables Monday, October 19, 2009 6:11 AM (permalink)
0

While checking a HTA/VBS programming project  over for bugs yesterday I realized I had forgotten to include the DTD line at the start. When I put it in all the tables in my project started doing very strange things. Although I am self taught I do consider myself at least fairly well experienced with html/css, but I must admit this has me stumped how to fix it. I programmed the whole thing in xhtml and I'm aware of the general bugs that this produced in browsers but I seem to have managed to avoid this particular one in the past.
When I include the DTD line at the start, IE7 completely ignores any reference to table row/cell height/width whether passed by CSS or html input. I tried with other doc types (html strict etc.) but they all seemed to produce the same result. I opened up the file in Chrome and it interprets it fine, it just seems to be IE7 that can't handle it (I haven't tested it with IE8 yet). Does anyone know a way around this? I've included my code below. I'd prefer not to have to use CSS position:absolute, but if it's the only way then I'll resign myself to it. Thanks anyone who takes the time to look.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Field Ministry Organizer</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> 


<style type="text/css">
html,body {
padding:0px;
margin:0px;
width:100%;
height:100%;
}
</style>
</head>
<body>
<table border="1" style="height:100%; width:100%;">
<tr style="height:21px;">
<td colspan="2">
1
</td>
</tr>
<tr>
<td style="width:75px;">
2
</td>
<td>
3
</td>
</tr>
<tr style="height:21px;"">
<td colspan="2">
4
</td>
</tr>
</table>
</body>
</html>

edit: I Just tried firefox and IE8, it works fine in both of them, looks like it's definitely an IE7 bug. Unfortunately as most people don't bother to upgrade their browser to the latest version (If it's IE) and Microsoft don't seem to be pushing IE8 out to all computers, I need to have this program working it IE7 and IE8. Any help much appreciated.

edit 2: I found that if I apply  table-layout:auto; I can at least make the cell with "2" in it display at the right width (75px), but it doesn't help the height issue.
<message edited by swiftoid on Monday, October 19, 2009 8:31 AM>
Jamie Swift
 
#1

    Online Bookmarks Sharing: Share/Bookmark

    Jump to:

    Current active users

    There are 0 members and 1 guests.

    Icon Legend and Permission

    • New Messages
    • No New Messages
    • Hot Topic w/ New Messages
    • Hot Topic w/o New Messages
    • Locked w/ New Messages
    • Locked w/o New Messages
    • Read Message
    • Post New Thread
    • Reply to message
    • Post New Poll
    • Submit Vote
    • Post reward post
    • Delete my own posts
    • Delete my own threads
    • Rate post

    2000-2012 ASPPlayground.NET Forum Version 3.9