#1 (permalink)  
Old 03-22-2005, 08:52 AM
Registered User
 
Join Date: Mar 2005
Posts: 1
Unhappy Interesting table behavior in IE6

I've got some very weird table issues in IE6. The code is very simple:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>test</title>
<style type="text/css">
body { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
</style>
</head>
<body>
<table cellspacing="0" cellpadding="0" bgcolor="red" width="100%">
<tr>
<td bgcolor="blue" width="425" rowspan="2">Cell 1</td>
<td bgcolor="green" width="335">Cell 2</td>
<td bgcolor="purple" width="*" rowspan="2">Cell 4</td>
</tr>
<tr>
<td bgcolor="orange">Cell 3</td>
</tr>
<tr><td colspan="3">
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah blah blah blah
blah blah blah blah
</td></tr>
</table>
</body>
</html>

Not exactly rocket science, is it? This is rendered as expected:

Code:
--------------------------------------------------------------------
|Cell 1            | Cell 2                        |Cell 4           | 
|                  -----------------------------                     |
|                  | Cell 3                         |                |
--------------------------------------------------------------------
| blah blah blah blah blah blah blah blah                            |
--------------------------------------------------------------------
But as soon as I add on more 'blah' to the bottom cell (the one that spans 3 columns) the alignment goes haywire and cell 1 widens radically:

Code:
--------------------------------------------------------------------
|Cell 1                   | Cell 2                        |Cell 4    | 
|                         -----------------------------              |
|                         | Cell 3                        |          |
--------------------------------------------------------------------
| blah blah blah blah blah blah blah blah blah                       |
--------------------------------------------------------------------
In other words, as soon as the line of text in the bottom cell straddles some mysterious limit, all width declarations for the cells above go out the window. I have this problem with IE6.0.2800.1106.xpsp2. Firefox, Mozilla and Opera render this code perfectly.

What's going wrong here, why, and what can I do about it?

(The behavior of the above HTML code may depend on your window size, font size, and what not... maybe you'll have to add or remove a few blah's in order to trigger the problem and straddle the magical boundary.)

All reactions are grealy appreciated!
Reply With Quote

  #2 (permalink)  
Old 03-22-2005, 10:29 AM
Registered User
 
Join Date: Mar 2005
Posts: 5
im not sure this is what you want but i think what you'e missing is "colspan". cell 1 to cell 4 should be set to colspan=1 and the blah blah cell to colspan=3.

if your cell 1 widens to the length of the text of the blah cell, then that should be whats going to resolve your problem.
have you tried to make a border to the table to see how the cells react (border=1) ?

hope this will help
Reply With Quote
  #3 (permalink)  
Old 03-22-2005, 10:32 AM
Registered User
 
Join Date: Mar 2005
Posts: 5
oops ive just reread your code and i havent noticed you used colspan i guess my advice is kind of useless then sorry...
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT -5. The time now is 05:40 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter