Solved

CSS: why is Mozilla bleeding borders with border-collapse in my code?

Posted on 2004-08-02
6
454 Views
Last Modified: 2010-08-05
Hi, here's some code that works great in IE, but not Mozilla.

border collapse seems to cause the problem but I need border-collapse (although it may not be apparent why in this example... but I do need it in IE. In mozilla I don't need it but I can't figure out a way to set border-collapse only for IE except via DHTML which I don't want to use)

Any ideas?


<STYLE TYPE="text/css">
<!--
TABLE.sheet {border-collapse: collapse}
TD.f0 { border-left: solid 2pt black; border-right: solid 2pt black; border-top: solid 2pt black; border-bottom: solid 2pt black; font-family: "Arial"; font-size: 10pt; background-color: #ffff00; vertical-align: top;}
TD.f1 { font-family: "Arial"; font-size: 10pt; vertical-align: bottom;}
TD.f2 { border-left: solid 2pt #3366ff; border-right: solid 2pt #3366ff; border-top: solid 2pt #3366ff; border-bottom: solid 2pt #3366ff; font-family: "Arial"; font-size: 10pt; font-weight: bold; font-style: italic; background-color: #99ccff; vertical-align: top;}

-->
</STYLE>
<TABLE class=sheet>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 1</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 2</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD class=f0 ROWSPAN=2 COLSPAN=2> Merged Cells</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=f1 align=right> 1</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 3</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=19 style='height:14.25pt'>
    <TH class=row> 4</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 5</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD class=f2 ROWSPAN=2 COLSPAN=2>Merged Cells</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
  <TR class=sheet height=18 style='height:13.5pt'>
    <TH class=row> 6</TH>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
    <TD width=64 style='width:48pt' class=sheet>&nbsp;</TD>
</TABLE>
0
Comment
Question by:ycomp
6 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 250 total points
Comment Utility
Sure, set it like this:

TABLE.sheet {_border-collapse: collapse}

This would be IE-only
0
 
LVL 14

Assisted Solution

by:dfu23
dfu23 earned 250 total points
Comment Utility
<!--[if gte ie 5.5000]>
<style type="text/css">
TABLE.sheet {border-collapse: collapse}
</style>
<![endif]-->
0
 

Author Comment

by:ycomp
Comment Utility
wow guys thanks.. I wish I'd known about these things the other day. Would have saved me much time.
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:ycomp
Comment Utility
Zyloch, what is the logic behind the underscore ?
0
 
LVL 31

Expert Comment

by:seanpowell
Comment Utility
http://wellstyled.com/css-underscore-hack.html

I wish I was sure you needed to do it this way though :-)

And watch your table code there...
0
 

Author Comment

by:ycomp
Comment Utility
thanks sean.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now