CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 29th, 2004, 07:05 PM
JeffCT JeffCT is offline
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
<TD> + CSS "padding" causes overlap in IE?

Due to CSS2 cross-browser issues, I am still using tables for layout, but at the same time trying to move as much layout to stylesheets as possible.

One thing I have noticed in Internet Explorer 6 is when I use a <td> within a table that has no cellpadding, cellspacing, or border, if I use a box inside that tag that uses CSS "padding" or "margin", the content appears to be either overlapping other boxes or simply being cut off instead of wrapping.

ex:

Code:
<table>
<tr>
<td style="padding: 25px;margin-bottom:10px">
 some content here
</td>
</tr>
</table>


or this, has same behavior:

Code:
<table>
<tr>
<td>
 <div style="padding: 25px;margin-bottom:10px">
      some content here
 </div>
</td>
</tr>
</table>



Depending on what boxes I have around that table and the width of the browser window, the content is sometimes overlapped over other boxes or simply cut off.

How can I get the <td> to grow based on the content inside with respect to the padding or margins I set via CSS?

Reply With Quote
  #2  
Old April 30th, 2004, 02:36 AM
JeffCT JeffCT is offline
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
Tried it in Mozilla and Opera - the problem does not seem to affect either of these browsers. I also noticed that in IE, if I change from margin to padding or change from doing a margin on all 4 sides to only two sides, different parts of the text will get cut off. Any ideas?

Reply With Quote
  #3  
Old April 30th, 2004, 03:10 AM
jabba_29's Avatar
jabba_29 jabba_29 is online now
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,787 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 6 Days 13 h 54 m 58 sec
Reputation Power: 1640
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
IE6 seems to be very buggy with padding inside divs. I have had lots of problems with this sort of thing. I have ended up having to add IE6 specific code in some of my pages so that padding effect is the same in different browsers. I use external CSS, then implement specific IE6 code staight after using
Code:
<!-- protect other browsers from IE6's quirks -->
<!--[if IE 6]>
<style type="text/css">
/* specific IE6 padding stuff */
</style>
<![endif]-->

Pain in the *ss I know, but that was the only work-around I could find for my solution. Hope it gives you a bit of an insight.
__________________
Cheers,

Jamie

# mdb4u | The mobile movie database | Please help to test and promote
# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.



__________________

Reply With Quote
  #4  
Old April 30th, 2004, 12:34 PM
JeffCT JeffCT is offline
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
Thanks for the reply. If it is not too much to ask, could you elaborate on what sort of IE specific code you use?

Reply With Quote
  #5  
Old April 30th, 2004, 01:53 PM
Akh's Avatar
Akh Akh is offline
|<.+#f@#+.&.|
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2002
Location: norway
Posts: 2,650 Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level)Akh User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 6 Days 16 h 55 m 48 sec
Reputation Power: 588
it is called conditional comments,
not that i like it that much, but its a easy way serve secific css to msie.

more about these comments.
http://msdn.microsoft.com/workshop/...comment_ovw.asp
http://www.quirksmode.org/css/condcom.html
http://www.virtuelvis.com/archives/158.html

Reply With Quote
  #6  
Old April 30th, 2004, 02:24 PM
jabba_29's Avatar
jabba_29 jabba_29 is online now
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,787 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 6 Days 13 h 54 m 58 sec
Reputation Power: 1640
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
My actual example was in my normal (working Mozilla / Opera / IE5) I had certain divs that had padding as follows:
Code:
#content {
  width: 67%;
  float: left;
  margin: 1px;
  padding: 1% 2%;
}
As Akh pointed out the correct name for this, I have conditional comments as follows
Code:
<!-- protect other browsers from IE6's quirks -->
<!--[if IE 6]>
<style type="text/css">
#content {
  padding: 0;
}
</style>
<![endif]-->
As the comments come after the original CSS is called, in the head of the document, it over-rides previous style statements and seems to work - at least for me. Hope that helps.
PS: Thanks Akh for the links

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > <TD> + CSS "padding" causes overlap in IE?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway